0

I am trying to automate a web task so I decided to use selenium library.

I created a sample code just to experiment with the library but I'm finding that I'm getting a AttributeError on my driver object for the find_element_by_id method. Based on what I have found online this is a actual method that should work

This is the code I used below(Note: I am doing this in jupyter notebook)

!pip install selenium
from selenium import webdriver

# Create an instance of the web driver
driver = webdriver.Chrome()

# Open a webpage
driver.get('https://www.youtube.com/')

# Find an element and click it
element = driver.find_element_by_id('guide-icon')
element.click()

# Close the browser
driver.quit()

Error message below: enter image description here

The code is just suppose to click a single button and then close out

Cha
  • 35
  • 6

0 Answers0