通过BeautifulSoup在网页上解析数字

时间:2017-02-02 03:58:11

标签: python parsing beautifulsoup

我想从this website dashboard解析一个数字。该号码位于“有机搜索”

下方

在汤上使用简单的cmd-F,我终于意识到我的汤根本不包含这个数字。很高兴听到关于为什么这样做的建议。

1 个答案:

答案 0 :(得分:1)

此页面由JavaScrip呈现,响应将为:

enter image description here

真实数据在此网址中:

import requests

r = requests.get('https://us.backend.semrush.com/?key=adb79c4ec6282f461fb0e2e67aa50949&action=report&type=url_organic&currency=usd&url=https%3A%2F%2Fwww.yelp.com%2Fbiz%2Fplayground-2-0-santa-ana-3&_=1486008342774')
data = r.json()
data['organic']['traffic']