【发布时间】:2019-09-12 00:16:22
【问题描述】:
我正在尝试从该页面上抓取一些数据。
https://www.australiacouncil.gov.au/research/electorate-profiles/wright/#!Wright
问题是我无法使用 BeautifulSoup 和 Python 获得 87%。
当我跑步时:
soup.find("div",{"class":"progress-bar-item progress-bar-item--text "})
我得到的是 {{perc}} 而不是实际数字。
【问题讨论】:
-
这是因为“87%”可能是通过 java 脚本在您的机器上(相对于服务器上)实时计算的。您可能想考虑使用
selenium -
谢谢,我想可能是这样,但我想我最好先检查一下蜂巢思维。
标签: python html web-scraping beautifulsoup python-requests