I have a python script that is utilizing selenium with the chrome webdriver. When I load pages sometimes it'll get stuck because some javascript is trying to load. If I run the line:
driver.execute_script("$(window.stop())")
that occasionally (but not reliably) works to simulate the stop browser action. My other thought was to change the page_load_timeout to 5s. That will throw an error when this annoying javascript isn't loading. I want to stop the page from loading with the timeout, but then run the function that I initially wanted to run... How do I accomplish that?