我在 Python 中尝试了以下代码
url="http://www.realtor.com/realestateandhomes-search/Pittsburgh_PA/type-single-family-home/price-na-30000/sby-1/"
r=requests.get(url)
但它抛出错误
File "C:\Users\Dana\AppData\Local\Programs\Python\Python35-32\lib\site-package
s\requests\sessions.py", line 630, in send
history = [resp for resp in gen] if allow_redirects else []
File "C:\Users\Dana\AppData\Local\Programs\Python\Python35-32\lib\site-package
s\requests\sessions.py", line 630, in <listcomp>
history = [resp for resp in gen] if allow_redirects else []
File "C:\Users\Dana\AppData\Local\Programs\Python\Python35-32\lib\site-package
s\requests\sessions.py", line 111, in resolve_redirects
raise TooManyRedirects('Exceeded %s redirects.' % self.max_redirects, respon
se=resp)
requests.exceptions.TooManyRedirects: Exceeded 30 redirects.
任何帮助将不胜感激
原文由 Andrei 发布,翻译遵循 CC BY-SA 4.0 许可协议
更新如果你在这里截至 2022 年 6 月 10 日:
IT 似乎 PyPi 有问题,这是问题的根本原因
来源: https ://status.python.org/