samedi 31 octobre 2015

web scraping python flashscore

I'm trying to learn how to scrape websites with python. Now when I try to scrape the links of soccer games from a table from the site: http://ift.tt/1KMGgnh I get a strange code like this:

{¬ZX÷00Netherlands.011rlands00000000116000Eredivisie..010ivisie¬~AA÷0f3WSLFa¬AD÷1446231600¬AB÷3¬CR÷3¬AC÷3¬CX÷Heracles¬ER÷Round 11¬AX÷1¬BX÷-1¬WM÷HER¬AE÷Heracles¬WU÷heracles¬AS÷1¬AZ÷1¬AG÷2¬BA÷2¬BC÷0¬OA÷team¬WN÷WIL¬AF÷Willem II¬WV÷willem-ii¬AH÷1¬BB÷0¬BD÷1¬OB÷team¬AW÷1¬AN÷n¬~AA÷M34ST10g¬AD÷1445787900¬AB÷3¬CR÷3¬AC÷3¬CX÷Feyenoord¬ER÷Round 10¬AX÷1¬AV÷1445829000|}

while when I control element in my browser it just gives me normal html with tr with in there the id of the tr which is what I will need. How can I manage to get this? I just use the code:

 import requests
 from bs4 import BeautifulSoup
 r = requests.get("http://ift.tt/1KMGgnh")
 soup = BeautifulSoup(r.content)
 htmltext = soup.prettify()
 print htmltext




Aucun commentaire:

Enregistrer un commentaire