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'
1
  • it should be find_elements_by_class_name("content") Commented Aug 9, 2020 at 14:28

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

1 Comment

Please don't answer the duplicate questions, flag them instead. Please see how should duplicate questions be handled

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.