【发布时间】:2021-07-01 04:40:39
【问题描述】:
我正在尝试从网络上抓取一些由 Automate the Boring Stuff 教授的内容。我想知道如何解决 503 服务器错误 下面是代码的sn-p。不仅是这个特定的 URL,而且我尝试的几乎所有 URL 都会引发此错误。
import requests
re = requests.get('http: //www.amazon.com/Automate-Boring-Stuff-Python-2nd/dp/1593279922/')
re.raise_for_status()
requests.exceptions.HTTPError: 503 Server Error: Service Unavailable for url: https://www.amazon.com/Automate-Boring-Stuff-Python-2nd/dp/1593279922/
【问题讨论】:
-
是什么让您认为这是可以“解决”的问题?如果 URL 已损坏,您会怎么做?
-
网址没有损坏,点击即可访问
标签: python-3.x python-requests