Python Forum

Full Version: Selenium Chromedriver Automation Help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm fairly new to programing and have been trying my best to get a grasp of different concepts. I've made a few games and twitter bots, and am looking at trying some web scrapping/automation.

I have been following along with this tutorial https://www.youtube.com/watch?v=f7LEWxX4AVI
and have gotten stuck trying to enter text into the search bar. I'm using chrome Version 81.0.4044.129 and have the right Chromedriver to go with it.

This is my code from the tutorial -

from selenium import webdriver

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

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

searchButton = driver.find_element_by_xpath('//*[@id="search-icon-legacy"]')
searchButton.click()

It opens up chrome but does not enter anything into the search bar
?
https://gyazo.com/68da5e2e2340265ae50125558ed8ed11

I get these errors that open in a new window
and I get these in my python shell

?
https://gyazo.com/e9d702ef1ec4e4bc422ae537a3b59fbe

any advice would be very much appreciated.

Thanks
there's a scraping tutorial on this forum that covers selenium
web scraping part 1
web scraping part 2