相关疑难解决方法(0)

urllib2.URLError:<urlopen错误[Errno 11004] getaddrinfo failed>

如果我跑:

urllib2.urlopen('http://google.com')
Run Code Online (Sandbox Code Playgroud)

即使我使用其他网址,我也会遇到同样的错误.

我很确定我的计算机或路由器上没有运行防火墙,而且互联网(来自浏览器)运行正常.

python urllib2

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

urlopen 错误 [Errno 11001] getaddrinfo 失败

我是 Python 新手,正在学习视频教程。

所以这是代码片段

from urllib.request import urlopen
with urlopen('http://sixty-north/c/t.txt') as story:
    story_words = []
    for line in story:
        line_words = line.decode('utf-8').split()
        for word in line_words:
            story_words.append(word)
Run Code Online (Sandbox Code Playgroud)

我可以http://sixty-north.com/c/t.txt在我的浏览器中访问。

但是,当我在命令提示符中键入以下内容时:出现python words.py此错误:

C:\New folder>python words.py
Traceback (most recent call last):
  File "C:\Python33\lib\urllib\request.py", line 1248, in do_open
    h.request(req.get_method(), req.selector, req.data, headers)
  File "C:\Python33\lib\http\client.py", line 1065, in request
    self._send_request(method, url, body, headers)
  File "C:\Python33\lib\http\client.py", line 1103, in _send_request
    self.endheaders(body)
  File "C:\Python33\lib\http\client.py", line 1061, in endheaders
    self._send_output(message_body)
  File "C:\Python33\lib\http\client.py", line 906, …
Run Code Online (Sandbox Code Playgroud)

python python-3.x

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

Python urllib2 HTTPS和代理NTLM身份验证

urllib2似乎一般不支持使用代理身份验证的HTTPS,甚至更少使用NTLM身份验证.任何人都知道在代理上使用NTLM身份验证的HTTPS是否有补丁.

问候,

洛朗

python authentication https proxy ntlm

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

标签 统计

python ×3

authentication ×1

https ×1

ntlm ×1

proxy ×1

python-3.x ×1

urllib2 ×1