2

New to coding and programming here. Just wondering if anyone knows why the code below is returning an "ElementNotInteractableException" error? It seems to be coming from the "search" part because I run the code without it an I did not get an error. I am trying to automate a YouTube search for "cat videos". I'm able to open YouTube but not perform the typing on the search bar. Thanks a lot!

Below is the code:

from selenium import webdriver

driver = webdriver.Chrome()
driver.get('http://youtube.com')

search = driver.find_element_by_xpath('//*[@id="search"]')
*search.send_keys('cat videos')*

searchButton = driver.find_element_by_xpath('//*[@id="search-icon-legacy"]')
searchButton.click()
3
  • I saw you rejected my edit. I was just trying to help. Your writing style here sounds arrogant, and the code formatting was missing. Best of luck! Commented Jul 2, 2020 at 23:19
  • 1
    Hi Armando, thanks for your feedback and for letting me know that the comment I saw was a legit comment, & that posts can be edited by other users that way. I had no intention to offend you. I thought it was just a random Stackoverflow notification because it did not show any solution so I just got rid of it w/o really understanding what that whole edit permission notification that I got, meant. I am new here & am still learning how to navigate this system. Thanks for trying to help me (was actually wondering how to format the code) and I'm sorry I offended you. Please send your edit again. Commented Jul 3, 2020 at 0:37
  • All good ;) you can format your code with a tripple tick ``` Commented Jul 3, 2020 at 0:49

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.