天道酬勤,学无止境

403

爬虫403问题解决urllib.error.HTTPError: HTTP Error 403: Forbidden

一、爬虫时,出现urllib.error.HTTPError: HTTP Error 403: ForbiddenTraceback (most recent call last): File "D:/访问web.py", line 75, in <module> downHtml(url=url) File "D:/urllib访问web.py", line 44, in downHtml html=request.urlretrieve(url=url,filename='%s/%s.txt'%(savedir,get_domain_url(url=url))) File "C:\Python35\lib\urllib\request.py", line 187, in urlretrieve with contextlib.closing(urlopen(url, data)) as fp: File "C:\Python35\lib\urllib\request.py", line 162, in urlopen return opener.open(url, data, timeout) File "C:\Python35\lib\urllib\request.py", line 471, in open response = meth(req, response)

2021-05-12 00:22:30    分类:博客    403   HTTPError   urlretrieve   脚本编程