Python TooManyRedirects : Exceeded 30 redirects

标签 python python-3.x python-requests

我已经在 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.

任何帮助将不胜感激

最佳答案

更新如果你在这里截至 2022 年 6 月 10 日:

IT 似乎 PyPi 有问题,这是问题的根本原因

enter image description here

来源: https://status.python.org/

关于Python TooManyRedirects : Exceeded 30 redirects,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42237672/

相关文章:

python - Pandas 将列从一个数据框复制到另一个具有不同名称的数据框

python-3.x - 如何从requests.exceptions.ChunkedEncodingError获取错误代码

python - 使用 Python 从 Internet 下载大型 CSV 文件的进展

python - 从源目录导入 TensorFlow 是什么意思?

python - 是否可以为 PySequence_Fast 循环仅调用一次 PyObject_CallMethod?

Python 列表理解嵌套循环

python - 为第三方库/模块扩展 stub 文件

python-3.x - TensorFlow:神经网络在训练和测试集上的准确率始终为 100%

python - 不知道发布搜索按钮的 btnSearch.x 和 btnSearch.y 值

python - 在其余代码单独运行的同时持续检查网络可用性