Help Dealing with Javascript Loading (with #)
#1
hi again!

I am making some steady progress with my LiveLeak plugin, but I ran into a snag and I'm not sure how to have xbmc overcome it.

I wrote out this:
Code:
if after[0] == 'b':
      try:
        appdg = after.split('&')[1]
        before = after.split('&')[0]
        appdg = int(appdg.split('=')[1]) + 1
        newURL = before + "&page=" + str(appdg)
      except:
        newURL = after + "?i=1&page=2"
        appdg = 2
    elif after[0] == 'c':
      try:
        appdg = after.split('#')[1]
        before = after.split('#')[0]
        appdg = int(appdg.split('=')[1]) + 1
        newURL = before + "#item_page=" + str(appdg)
      except:
        newURL = after + "#item_page=2"
        appdg = 2
    addDir("Page " + str(appdg), newURL, 1, "")

to deal with paging. The first one works (with the &page=foo) but the second doesn't. I checked my logs and they are ok, and I'm reading the right information from the url and parsing it right. The problem is that the page loads and then deals with the #item_page=foo. So what xbmc sees is the initial load and then nothing more. How can I make it wait for the javascript function to take place? Like maybe a wait(5) or something.

I'm not sure how else to deal with this issue...any push would be very helpful!

thanks!

Oh and the code is https://github.com/oneadvent/plugin.liveleak
Reply
#2
OK did a bunch of research and found that urllib2 does not support javascript, so I changed the way I do it and reads better anyway.
Reply

Logout Mark Read Team Forum Stats Members Help
Help Dealing with Javascript Loading (with #)0