browser=webdriver.Firefox()
browser.set_page_load_timeout(4)
try:
browser.get("https://9gag.com")
except:
print("Page took too much time to load")
When I run the above code it will execute except: block always and prints "Page took too much time to load"
But when I run the code below in which I create a page where there is a button with id newPage and it opened the link(9gag) in new tab as soon as it is clicked. I don't get any exception.It take complete time to load and then print the url of the website
browser=webdriver.Firefox()
browser.get("file:///F:/documents/html_level_one/link_to_extreme_page_load.html")
browser.set_page_load_timeout(4)
browser.find_element_by_id("newPage").click()
browser.switch_to_window(browser.window_handles[-1])
print(browser.current_url)
I am using Firefox 28 and selenium 2.41
