2017-08-29 165 views
0

我试图从网站上抓取数据,我给了用户名和密码,但仍然给我以下错误。Spyder - 网页抓取

"URLError: urlopen error [Errno 11004] getaddrinfo failed>" 

这里是我的代码:

import urllib.request as req 

proxy = req.ProxyHandler({'http':r'http://abca:[email protected]@: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() 

感谢&问候, 桑杰

回答

0

URL 101

人物应该用百分之编码时,特别是结肠和@ -sign因为它们是语法的一部分。