我试图从网站上抓取数据,我已经提供了用户名和密码,但它仍然给我带来了以下错误。
"URLError: urlopen error [Errno 11004] getaddrinfo failed>"
这是我的代码:
import urllib.request as req
proxy = req.ProxyHandler({'http':r'http://abca:Password__@123@:192.168.115.116:8080'})
auth = req.HTTPBasicAuthHandler()
opener = req.build_opener(proxy, auth, req.HTTPHandler)
req.install_opener(opener)
conn = req.urlopen('http://www.google.com')
return_str = conn.read()
谢谢&问候, 桑杰