<br />
content = HTML.ElementFromURL(pageUrl)<br />
NameError: global name 'HTML' is not defined<br />
I've been working through some examples and references other plugins and it is the same syntax used in each one. Does anyone have any idea what the issue might be?
Only difference I can find is that I a using an IP address for the URL rather than a domain name. I assumed this would not cause any problems.
That did seem to fix it but should I be using V.2?
Also, all of the information I want to use for my objects is stored in a table. No usable div tags or much of anything.
XPath Checker found this: id(‘Main’)/x:table/x:tbody/x:tr but Plex doesn’t like it. I’ve been able to get my list of object displaying using: //table/descendant::a but I can’t get the additional information I want to be able to display.
To do that, I need a way to find out how many rows are in the table so I can loop through them to pull out the necessary information.
I can use this: id(‘Main’)/x:table/x:tbody/x:tr[19]/x:td[4] and increment the row/column count --> but again, Plex doesn’t like this syntax.
Help!? Not a complete noob but new to Python and XPath. I’m sure there is a more efficient way to grab the info I need.
V1 plugins are still very common and still being developed. When I started developing plugins I decided to dive right into V2. I assumed (right or wrong) that the goal is to eventually migrate all the plugins to V2. From a development standpoint, there really are only a few differences which are laid out pretty well in Sander’s thread about upgrading from V1 to V2.
When you’re using xpath checker it will throw in a ‘x:’ in fron t of the items in the path. So, for your table you could probably use something like:
data = content.xpath('//table/tbody/tr')
to return a list of all the
elements in the table. Then if you put that in a for loop, you can cycle through each element to pull out the relevent info you want.
That xpath should work for v1 as well. Just use the XML.ElementFromUrl example Dbl_A provided.
Something like this...
content = XML.ElementFromUrl(pageUrl, isHTML=True<br />
fot data in content.xpath('//table/tbody/tr'):<br />
### here's where you process each item ###<br />
### make sure to indent properly###
If you want to dive into v2, you need to update the Info.plist file.
I would just look at an existing v2 plugin and compare the Info.plist's between the two.
I’ve got my menu populated. Now working on the site configuration. Most of the videos I’m trying to use are embedded from other locations so I’m not sure how to find the ‘plugin’. Any direction?
Thanks, Mike. I moved my questions to a more specific topic, here: http://forums.plexapp.com/index.php/topic/23120-plugin-help/page__gopid__144163#entry144163
and have had some others chime in and got my questions answered.