BeautifulSoap和Urllib2

问题描述 投票:-3回答:1

我正在使用以下代码,试图在Python变量中获取所有网站数据。

url = "<url>"
page = urllib2.urlopen(url)
html = page.read()

print(html)

soup = BeautifulSoup(page, 'html.parser')

soap / page变量中存储的内容只是HTML布局,包括嵌套的js脚本。

为什么没有实际的网站数据?

python beautifulsoup urllib2
1个回答
0
投票

问题已解决。它与Python库无关,但与身份验证有关。

© www.soinside.com 2019 - 2024. All rights reserved.