Quote:
Originally Posted by TonytheBookworm
Okay after messing with this for a while I finally figured out why the pcard is not showing up. Yet, I don't know how exactly to fix it. So could you hook the jumper cables to me and give me a jump-start please ?
When using liveHttp and tamperData i noticed that a request is sent out for
http://www.nfl.com/widget/playercard...n=2010&gameId= (which turns out to be the pcard data)
So my question is: do i add that as an addheader? or is it a br.open('http://www.nfl.com/widget/playercard?esbId=EDW720778&season=2010&gameId=') ?
Sorry for all the questions but i'm totally in the dark on this one
|
You're close. Note that "esbId=EDW72077" is the player ID. The player ID is in the iframe part of the page you're scraping. Here's code grabbed from a print in the recipe:
Code:
<iframe src="/widget/playercard?esbId=NOR780922&season=2010&gameId=" id="pcard-EOCVFPSS" frameborder="0"></iframe>
You just build the URL, grab the soup with:
Code:
soup = self.index_to_soup(URL)
then put it into your soup of the page where you want it.