I've written a selenium program to search specific keywords using google. But I found that it always waits for the page to load, sometimes it waits too long, and the page seems to be stuck there. Then my program stopped there with a timeout exception. as my code shows below:
ActionChains(driver).send_keys_to_element(input, keyword).send_keys(Keys.ENTER).perform()
driver.switch_to.window(main_window)
I need when the google page gets the keyword into the input area, maybe 1 or 2 seconds later, the program will go on to the next step the get another keyword from the main window. I've tried the implicit or explicit wait, but I don't want to deal with the exception, I don't want the exception to interrupt my program, I don't mind if several pages have been completely executed.
How to set it up?