【发布时间】:2017-01-20 11:02:18
【问题描述】:
我尝试使用 bs4 从一个 NBA 统计网站获取表格。
该网站似乎没有使用 JavaScript。
soup.prettify 打印结果看起来很正常,但我无法使用soup.find_all 来获取我想要的表格。这是我正在使用的代码:
import requests
from bs4 import BeautifulSoup
url = 'http://stats.nba.com/team/#!/1610612738/stats/'
page = requests.get(url)
html = page.content
soup = BeautifulSoup(html, 'html.parser')
tables = soup.find_all('table')
【问题讨论】:
标签: python python-3.x web-scraping beautifulsoup