I have been trying to scrape this site and sending in the search phrase cause error.
AttributeError: 'NoneType' object has no attribute 'send_keys'
I have searched StackOverflow and the error usually is resolved when you redefine the web element again which I did but still getting the same error.
I do not want to directly go to the search link like https://www.couriermail.com.au/search-results?q=Anthony+Albanese instead I want to click on the search icon and after the input field is open send in the search phrase.
Here is what I have tried
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "/html/body/nav/form/button"))).click()
search = driver.find_element(by=By.XPATH,value='/html/body/nav/form/button').click()
search.send_keys("Anthony Albanese")
time.sleep(10)
search.send_keys(Keys.ENTER)
I have tried simulating the typing-like behavior but it results in other errors stackoverflow help
This is the HTML of the page that I am referring to The HTML of the search icon so my question is what I am doing wrong? I have tried redefining the web element or imitating the typing-like behavior but I am not successful in getting the URLs of articles