Why I can't get page source in xbmc
#1
Hi,

I had a working plugin that I am fixing due to site changes. It seems when I look at the page source in FF or IE, I get the complete source code, but when I do that in XBMC, I do not get the complete source code to scrape for the stream. Can anyone help. Page I am trying to scrape is:

http://www.denverbroncos.com/cda-web/con...0&pageno=1

Here is the xbmc log:

http://pastebin.org/398956

XBMC version is r31755 on Windows XP. Please help...
Reply
#2
wouldn't it be easier if you save the page you get in code locally, so you can open it and see what's there.

you log just say nothing, no error seen.
Reply
#3
ppic Wrote:wouldn't it be easier if you save the page you get in code locally, so you can open it and see what's there.

you log just say nothing, no error seen.

I do that using a code like below, if that is what you mean by saving locally, but the variable 'link' gets totally different code when executed in XBMC vs. in Python directly. Python shows the right code as you see in FF/IE, but XBMC shows part of the code missing.

Code:
import os,sys,urllib2,re
import cookielib

url = 'http://www.denverbroncos.com/cda-web/content-list-dynamic-module-paginated.htm?displayName=Most%20Recent&contentType=VIDEO&sortField=DATE&showImage=Yes&showDescription=Yes&showPublicationDate=Yes&numberPerPage=10&pageno=1'
BASE_URL='http://www.denverbroncos.com/'

urlopen = urllib2.urlopen
Request = urllib2.Request
txdata = None
txheaders =  {'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3'}
cj = cookielib.LWPCookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
urllib2.install_opener(opener)

req = Request(url, txdata, txheaders)
response = urlopen(req)
link=response.read()
response.close()

Btw - line 94 and 95 do show errors in the log, I am just not sure what it means, and why I can't see it all in XBMC...
Reply
#4
nevermind, it was my bad the XBMC was creating .pyo files that were not letting my changes seen by XBMC Sad

Thanks for your help Smile
Reply
#5
your error line 94-95 is normal cause you're in plugin and do not set the endofdirectory code.

and yes code may be somehow different of what you see in ff, i use regexp buddy to find my regexp, and sometime i need to test it on local file where i store the data to be sure the code is good.

seems you've find your way, good Wink
Reply

Logout Mark Read Team Forum Stats Members Help
Why I can't get page source in xbmc0