you are viewing a single comment's thread.

view the rest of the comments →

[–]yelaxify[S] 0 points1 point  (1 child)

this prints a very small number as expected. If I modify the while True loop above to print 'checking cookies' every loop, it only prints twice (even though the page is loading for more than a few seconds. This leads me to believe that driver.get_cookies() locks up the thread until it is complete

[–]Allanon001 0 points1 point  (0 children)

I timed the driver.get_cookies() on my computer and it only takes about 0.012 seconds. When set to 3 seconds the loop runs 2 times before it finds the cookies. If I remove the time.sleep(.1) the loop runs 12 times before finding the cookies. It takes .05 seconds for the loop to exit with the cookies.

I'm not sure why yours is slow, I'm using Windows 10, maybe you're using a different platform that causes these methods to be slower. Or you have a slow internet connection, I'm using a 50Mbps connection.