旧版零基础学习python 第56讲 爬虫篇
urllib.error.HTTPError: HTTP Error 407: Proxy Authentication Required这个报错是什么意思??代理ip和端口没有问题是网址需要人机验证吗???求解 Traceback (most recent call last):
File "C:\Users\94060\Desktop\proxy.py", line 11, in <module>
response = urllib.request.urlopen(url)
File "E:\Python\lib\urllib\request.py", line 216, in urlopen
return opener.open(url, data, timeout)
File "E:\Python\lib\urllib\request.py", line 525, in open
response = meth(req, response)
File "E:\Python\lib\urllib\request.py", line 634, in http_response
response = self.parent.error(
File "E:\Python\lib\urllib\request.py", line 557, in error
result = self._call_chain(*args)
File "E:\Python\lib\urllib\request.py", line 496, in _call_chain
result = func(*args)
File "E:\Python\lib\urllib\request.py", line 749, in http_error_302
return self.parent.open(new, timeout=req.timeout)
File "E:\Python\lib\urllib\request.py", line 525, in open
response = meth(req, response)
File "E:\Python\lib\urllib\request.py", line 634, in http_response
response = self.parent.error(
File "E:\Python\lib\urllib\request.py", line 563, in error
return self._call_chain(*args)
File "E:\Python\lib\urllib\request.py", line 496, in _call_chain
result = func(*args)
File "E:\Python\lib\urllib\request.py", line 643, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 407: Proxy Authentication Required
tuza1205 发表于 2022-4-2 00:02
import urllib.request
url = 'https://www.ip138.com/'
你的这个代理不能用了,换个别的代理
你可以看一下这个大佬的项目,里面的第9个就是爬取免费代理的
https://fishc.com.cn/thread-210923-1-1.html 本帖最后由 isdkz 于 2022-4-1 20:33 编辑
tuza1205 发表于 2022-4-1 20:24
Traceback (most recent call last):
File "C:%users\94060\Desktop\proxy.py", line 11, in
resp ...
代理需要验证,或者你的代理并不可用 建议把代码放上来好让别人帮你调试 isdkz 发表于 2022-4-1 20:31
建议把代码放上来好让别人帮你调试
好的
isdkz 发表于 2022-4-1 20:31
建议把代码放上来好让别人帮你调试
import urllib.request
url = 'https://www.ip138.com/'
proxy_support = urllib.request.ProxyHandler({'http':'183.92.226.11:54844'})
opener = urllib.request.build_opener(proxy_support)
urllib.request.install_opener(opener)
response = urllib.request.urlopen(url)
html = response.read().decode('utf-8')
print(html) 厉害了 isdkz 发表于 2022-4-2 00:06
你的这个代理不能用了,换个别的代理
你可以看一下这个大佬的项目,里面的第9个就是爬取免费代理的
...
好的 我去瞅瞅 isdkz 发表于 2022-4-2 00:06
你的这个代理不能用了,换个别的代理
你可以看一下这个大佬的项目,里面的第9个就是爬取免费代理的
...
我这个代理之前是能用的 有时效 但是也还会报错407 tuza1205 发表于 2022-4-2 22:37
我这个代理之前是能用的 有时效 但是也还会报错407
好吧,建议你换个代理试试{:10_277:}
页:
[1]