L'url cible se lance bien, mais je ne parviens pas à comprendre pourquoi il ne saisit pas le texte type, "text".
code :
from selenium import webdriver
driver = webdriver.Firefox()
driver.get("https://www.youtube.com/")
searchbox = driver.find_element_by_xpath('//*[@id="search"]')
searchbox.send_keys("test")
searchbutton = driver.find_element_by_xpath('//*[@id="search-icon-legacy"]')
searchbutton.click()
erreur :
Traceback (most recent call last):
File "/Users/MacBook/Desktop/selenium_test.py", line 7, in <module>
searchbox.send_keys("test")
File "/Applications/anaconda3/lib/python3.7/site-packages/selenium/webdriver/remote/webelement.py", line 479, in send_keys
'value': keys_to_typing(value)})
File "/Applications/anaconda3/lib/python3.7/site-packages/selenium/webdriver/remote/webelement.py", line 633, in _execute
return self._parent.execute(command, params)
File "/Applications/anaconda3/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/Applications/anaconda3/lib/python3.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotInteractableException: Message: Element <g id="search"> is not reachable by keyboard
Merci d'avance.