0

I have a webcrawler that goes to a website to extract the contact info. However, for some websites, it takes way too long. My code is in a for loop. Is there a way that I can tell the program to "continue" to the next iteration if the for loop exceeds a certain n amount of time.

I was thinking of a try/except but I do not know how to implement time in the code.

Thanks.

ImNotARobot
  • 87
  • 1
  • 6
  • have a look at [this](https://stackoverflow.com/questions/492519/timeout-on-a-function-call) – Ma0 Mar 12 '20 at 14:37
  • Look at the documentation for the function you're using to fetch the webpages, and see if it has a timeout option. – John Gordon Mar 12 '20 at 14:39

0 Answers0