为什么使用Urllib和BS4有HTTP错误503?
我使用BS4从网站上从技术获取浏览标准: https://standards.globals.globalspec.com/
from urllib.request import urlopen
from bs4 import BeautifulSoup
url = "https://standards.globalspec.com/"
q1 = urlopen(url)
soup = BeautifulSoup(q1, 'lxml')
print(soup)
但是但是我有一个错误:urllib.error.httperror:http错误503:服务暂时不可用,
任何人都可以看到可能导致此错误的原因吗?
I use BS4 to get Browse Standards by Technology from website: https://standards.globalspec.com/
from urllib.request import urlopen
from bs4 import BeautifulSoup
url = "https://standards.globalspec.com/"
q1 = urlopen(url)
soup = BeautifulSoup(q1, 'lxml')
print(soup)
But i have an error: urllib.error.HTTPError: HTTP Error 503: Service Temporarily Unavailable
Could anyone see what could be causing this error?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
@samt94已经表示该网站受到CloudFlare的保护。因此,您可以使用
CloudScraper
而不是请求
output:
cloudscraper
@Samt94 already has stated that the website is under cloudflare protection. So you can use
cloudscraper
instead ofrequests
Output:
cloudscraper
您可以使用CloudScraper访问使用CloudFlare DDOS保护的网站:
You can use CloudScraper to access websites that use CloudFlare DDoS Protection: