小编Sir*_*org的帖子

Python 请求中的 url 超出了最大重试次数

我尝试向此 URL 发送请求:站点 URL

并使用以下代码进行简单的页面读取:

import requests
url_1 = 'http://www.dsit.org.ir/?cmd=page&Cid=92&title=Kontakt&lang=fa'
print(requests.get(url_1).text)
Run Code Online (Sandbox Code Playgroud)

但我收到这个错误:

requests.exceptions.ConnectionError: HTTPConnectionPool(host='www.srgfesrsergserg.com', port=80): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000008EC69AAA90>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
Run Code Online (Sandbox Code Playgroud)

该站点非常基础,没有特殊的安全措施。另外,我只请求过一次

一切都很好,我用Request-html很容易打开这个页面,但我不知道问题出在哪里!

python request httpurlconnection web-scraping python-requests

3
推荐指数
1
解决办法
3万
查看次数

ipython 7.19.0 崩溃

你好我将我的python从python 3.8.3更新到python 3.9.1并通过pip freeze> req和pip install req重新安装我的库和包当然,我在安装过程中更新了一些包,我安装了它的最新版本不是以前的版本像ipython。但是现在我在使用ipython 时遇到了问题

它根本不起作用,它不提供建议,如果我按 Tab For give Suggestion :/ (非常奇怪),它无法运行简单的 Python 行,并且它没有自动完成功能。

在这里,我在 CMD 中运行它并编写了一个简单的代码来执行:

某物

某物

python ipython python-3.x jupyter-notebook

2
推荐指数
1
解决办法
368
查看次数