Questions tagged «http-status-code-429»

5
如何避免HTTP错误429(请求过多)python
我尝试使用Python登录网站并从多个网页收集信息,但出现以下错误: Traceback (most recent call last): File "extract_test.py", line 43, in <module> response=br.open(v) File "/usr/local/lib/python2.7/dist-packages/mechanize/_mechanize.py", line 203, in open return self._mech_open(url, data, timeout=timeout) File "/usr/local/lib/python2.7/dist-packages/mechanize/_mechanize.py", line 255, in _mech_open raise response mechanize._response.httperror_seek_wrapper: HTTP Error 429: Unknown Response Code 我曾经使用过time.sleep()并且可以正常工作,但是似乎并不智能且不可靠,还有其他方法可以避免此错误吗? 这是我的代码: import mechanize import cookielib import re first=("example.com/page1") second=("example.com/page2") third=("example.com/page3") fourth=("example.com/page4") …

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.