Some help please...
Hi,I wanted to write a Plugin so i gave it a shot. It's a plugin for the website [22tracks.com](http://22tracks.com). This is what i've got so far:
<br />
MUSIC_PREFIX = "/music/22tracks"<br />
NAME = L('Title')<br />
ART = 'art-default.jpg'<br />
ICON = 'icon-default.png'<br />
<br />
####################################################################################################<br />
<br />
def Start():<br />
<br />
Plugin.AddPrefixHandler(MUSIC_PREFIX, MusicMainMenu, NAME, ICON, ART)<br />
Plugin.AddViewGroup("InfoList", viewMode="InfoList", mediaType="items")<br />
Plugin.AddViewGroup("List", viewMode="List", mediaType="items")<br />
MediaContainer.title1 = NAME<br />
MediaContainer.viewGroup = "List"<br />
MediaContainer.art = R(ART)<br />
DirectoryItem.thumb = R(ICON)<br />
VideoItem.thumb = R(ICON)<br />
HTTP.CacheTime = CACHE_1HOUR<br />
<br />
<br />
def MusicMainMenu():<br />
<br />
dir = MediaContainer(viewGroup="InfoList")<br />
dir.Append(<br />
Function(<br />
DirectoryItem(<br />
AmsMenu,<br />
"Amsterdam",<br />
subtitle="subtitle",<br />
summary="Playlists selected by specialized DJ's from Amsterdam",<br />
thumb=R(ICON),<br />
art=R(ART)<br />
)<br />
)<br />
)<br />
return dir<br />
<br />
<br />
def AmsMenu(sender):<br />
dir = MediaContainer(viewGroup="InfoList")<br />
for item in HTML.ElementFromURL("http://22tracks.com/ams#pop", errors='ignore').xpath('//ul[@class="genre-nav"]/li'):<br />
dir.Append(<br />
Function(<br />
DirectoryItem(<br />
CallbackExample,<br />
"1234",<br />
subtitle="subtitle",<br />
summary="clicking on me will call CallbackExample",<br />
thumb=R(ICON),<br />
art=R(ART)<br />
)<br />
)<br />
)<br />
return dir<br />
<br />
<br />
def CallbackExample(sender):<br />
<br />
return MessageContainer(<br />
"Not implemented",<br />
"In real life, you'll make more than one callback,
and you'll do something useful.
sender.itemTitle=%s" % sender.itemTitle<br />
)<br />
Now the problem is when i go to the website 22tracks.com and take a look at the source, there are no
- .
- 's I need to find for generating the dynamic AmsMenu list.
So is xpath just not possible for this website?
Thanks!
When I use firebug to view HTML there I see all the