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()
感謝&問候, 桑傑