I have below requirement to do the automation using selenium and python. Can someone please help me with the code:
- Enter the exact query string in the search box
- In the auto-suggest, the exact name is appearing as a suggestion.
- Manually the way it works is, if I click the auto-suggested option, then the new webpage opens.
I am stuck in step3.
My code is:
search_query = 'enter search string' driver = webdriver.Chrome('C:\\chromedriver\\chromedriver.exe') driver.get("about:blank") driver.get("enter website name") search_textbox = driver.find_element_by_xpath("//*[@id='txtCompanySearch']") #XPATH can be found with developer tools in browsers search_textbox.send_keys(search_query)