Python Selenium WebDriver how to add timeout to get(url) function
For all the web cretents out there what I used to solve this problem was this. Selenium uses the socket library so I set a timeout on the socket module, this throws an error which we can use to send the escape key to the browser (which stops the page loading):
socket.setdefaulttimeout(2)try: driver.get(pageLink)except socket.timeout: #send ESCAPE key to browser