0
try:
    main = WebDriverWait(driver, 10).until(
        EC.presence_of_element_located((By.ID, "main"))
    )
    articles = main.find_elements_by_tag_name("article")
    for article in articles:
        header = article.find_element_class_name("entry-title")
        print(header.text)
finally:
    driver.quit()

It shows the error as:

AttributeError: 'WebElement' object has no attribute 'find_element_class_name'
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352

1 Answers1

1

It should be find_element_by_class_name and find_elements_by_class_name for a list of elements with the given class name

Just for fun
  • 4,102
  • 1
  • 5
  • 11
  • Please don't answer the duplicate questions, flag them instead. Please see [**how should duplicate questions be handled**](https://meta.stackexchange.com/questions/10841/how-should-duplicate-questions-be-handled) – Yagiz Degirmenci Aug 09 '20 at 14:38