Retry for python requests module hanging

前端 未结 1 1883
别跟我提以往
别跟我提以往 2021-01-26 22:33

I had to use the request module to fetch a huge number of URLs. Due to network errors, I wanted to implement the Retry mechanism. So my code looks like this:

fro         


        
相关标签:
1条回答
  • 2021-01-26 22:42

    Just had the same problem and figured out that it's because of the website's header "Retry-After". By default, Retry uses that value to wait until the next request. To ignore it, set the respect_retry_after_header parameter to False when creating a Retry object.

    0 讨论(0)
提交回复
热议问题