【发布时间】:2017-01-18 17:10:20
【问题描述】:
我正在尝试解析以下页面:http://www.oddsportal.com/soccer/france/ligue-1-2015-2016/results/
我感兴趣的部分是获取表格以及分数和赔率。
我目前的代码:
url = "http://www.oddsportal.com/soccer/france/ligue-1-2015-2016/results/"
req = requests.get(url, timeout = 9)
soup = BeautifulSoup(req.text)
print soup.find("div", id = "tournamentTable"), soup.find("#tournamentTable")
>>> <div id="tournamentTable"></div> None
非常简单,但我因此奇怪地卡在树中查找表。虽然我找到了已经准备好的数据集,但我想知道为什么打印的字符串是标签而没有。
有什么想法吗?
谢谢
【问题讨论】:
标签: python python-2.7 beautifulsoup