我正在抓取一个网站。
import requests
url='https://stackoverflow.com'
r=requests.get(url)
content = r.text
print(content)
对于此代码,它运行良好。但是当我尝试连接其他网址
时url='http://www.iyingdi.com/web/article'
#Sorry you guys ,it is a Chinese website.But it does not matter.
#I don't find same problem in others English website.
输出:
<html>
<head>
<!--head part works well-->
</head>
<body>
<!--body part is empty-->
</body>
</html>
头部部分效果很好,但身体部位是空的!
尝试在Google或SOF中搜索,我没有发现同样的问题。
谢谢你的答案。