I am loading a page using the selenium web driver. But the page loads endlessly. I tried to catch the exception and simulate the action of the esc key, but that did not help. With some limitations, I can only use Firefox [I saw how chrome adds a solution]. Once I got to the page, I did not get control.
I set my Firefox profile as
firefoxProfile = FirefoxProfile() firefoxProfile.set_preference('permissions.default.stylesheet', 2) firefoxProfile.set_preference('permissions.default.image', 2) firefoxProfile.set_preference('dom.ipc.plugins.enabled.libflashplayer.so','false') firefoxProfile.set_preference("http.response.timeout", 10) firefoxProfile.set_preference("dom.max_script_run_time", 10)
Script to stop downloading:
try: driver.set_page_load_timeout(10) driver.get('http://www.example.com' except Exception print 'time out' driver.send_keys(Keys.CONTROL +'Escape')
source share