【发布时间】:2020-09-30 13:45:34
【问题描述】:
我试图使用 beautifulsoup4 和 python 来抓取某个网站。但是,当我尝试查看 URL 中的内容时,它只给了我一个标题部分,并没有给我想要使用的正文部分。
URL = "url"
URL_page = requests.get(URL)
print(URL_page.text)
这给了我
<!DOCTYPE html>
<html>
<head>
"Contents of Header"
</head>
<body>
<div id='root'></div>
</body>
</html>
body 标签内应该有内容,但它什么也不显示。 这个网页的原始html是这样的
<html xmlns:wb="http://open.weibo.com/wb" style>
▶<head...</head> ← ONLY GIVES ME THIS
▶<body data-loaded="true">...</body> ← I NEED THIS PART
</html>
【问题讨论】:
标签: python html google-chrome web-scraping beautifulsoup