我每天都在抓一小部分数据&代码在5天前就开始了。现在,在尝试时,我似乎无法得到任何503错误代码。
以下是导致问题的简单代码:
from urllib.request import Request, urlopen
website = "https://bitcointalk.org/index.php?board=1.0"
req = Request(website, headers={'User-Agent': 'Mozilla/5.0'})
data = urlopen(req).read()
print(data)
给出错误:
Traceback (most recent call last):
File "C:/Users/Clay/Desktop/python/airdrop/1.py", line 6, in <module>
data = urlopen(req).read()
File "C:\Users\Clay\AppData\Local\Programs\Python\Python36\lib\urllib\request.py", line 223, in urlopen
return opener.open(url, data, timeout)
File "C:\Users\Clay\AppData\Local\Programs\Python\Python36\lib\urllib\request.py", line 532, in open
response = meth(req, response)
File "C:\Users\Clay\AppData\Local\Programs\Python\Python36\lib\urllib\request.py", line 642, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Users\Clay\AppData\Local\Programs\Python\Python36\lib\urllib\request.py", line 570, in error
return self._call_chain(*args)
File "C:\Users\Clay\AppData\Local\Programs\Python\Python36\lib\urllib\request.py", line 504, in _call_chain
result = func(*args)
File "C:\Users\Clay\AppData\Local\Programs\Python\Python36\lib\urllib\request.py", line 650, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 503: Service Temporarily Unavailable
任何想法?在更改用户代理并仍然遇到相同问题后,我很失落。
我也有多个代理服务器,我尝试过循环使用它们并不适用于任何代理服务器。