【发布时间】:2020-07-05 08:14:11
【问题描述】:
我正在尝试对网站进行网络抓取,但当我这样做时,我的输出低于预期。 有什么方法可以抓取这个网站吗?
url = "https://www.mustang6g.com/forums/threads/pre-collision-alert-system.132807/"
page = requests.get(url)
soup = BeautifulSoup(page.text, 'html.parser')
print(soup)
以上代码输出如下
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access this resource.</p>
</body></html>
【问题讨论】:
-
anonymous13 - 非常感谢您的帮助请求 - 非常感谢您分享您的想法和交流想法。
标签: python web-scraping beautifulsoup