Python Forum

Full Version: Selenium webbrowser send entern and escape key
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi I am using Selenium webdriver. I am sending a search term into the browser to search. However, the website doesn't have a search button so I have to press enter followed by escape key to see the search results. I have done following thing but I want to know if there is a better alternative


wait( driver, 10 ).until( EC.visibility_of_element_located( (By.ID, "search-bar") ) ).send_keys( Keys.ENTER )
wait( driver, 10 ).until( EC.visibility_of_element_located( (By.ID, "search-bar") ) ).send_keys(Keys.ESCAPE )
I am a beginner.
Thank you.