0

I have a while True loop in my python code that carries out some tasks on a website I own. I'm doing a mixture things in this loop, including intercepting some network traffic using selenium wire.

Looking at the time stamp printed at the top of each loop, I can see that it takes progressively longer for each iteration of the loop, growing from about 20 seconds to 21 seconds on second iteration to 22 on third iteration etc.

I've had a close look at my code and can't see any memory usage being backed up and now wondering if this might be a known issue with selenium/selenium wire or websites in generally. When I run the code from scratch the time taken goes back to 20 seconds but then starts to creep longer and longer.

  • The obvious explanation is that inside your loop, you're processing some object (a list, a string, etc) that gets bigger and bigger with every loop iteration. Probably nothing to do with Selenium specifically. But impossible to say for sure, without seeing your code. – John Gordon Aug 08 '23 at 14:48
  • the question needs sufficient code for a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) – D.L Aug 08 '23 at 14:56

0 Answers0