Skip to content
Advertisement

AttributeError: ‘WebDriver’ object has no attribute ‘find_elemen_by_css_selector’

I get this error:AttributeError: ‘WebDriver’ object has no attribute ‘find_elemen_by_css_selector’

What is the current usage?

from selenium import webdriver


from selenium.webdriver.common.keys import Keys
import time

driver = webdriver.Chrome()

url = "http://github.com/"
driver.get(url)

search_input = driver.find_element("name", "q")

time.sleep(1)
search_input.send_keys("python")
time.sleep(3)
search_input.send_keys(Keys.ENTER)
time.sleep(1)
result = driver.find_elemen_by_css_selector(".repo-list-item h3 a")



for element in result:
    print(element)


driver.close()

Advertisement

Answer

Looks like you forgot a t

driver.find_element_by_css_selector(".repo-list-item h3 a")
Advertisement