2

I know this question seems to have been asked before, but when I try emulating the responses that worked for others, there is still an issue.

My code is:

table = driver.find_element_by_xpath('//*[@id="tabdocsumtable"]/tbody')      
entries = table.find_elements_by_class('rprt')

I am getting

AttributeError: 'WebElement' object has no attribute 'find_element_by_class'

Link to webpage: https://www.ncbi.nlm.nih.gov/clinvar/?term=setx%5Bgene%5D

3
  • 1
    How about table.find_elements_by_class_name? I'll post as an answer if leaving off _name was your issue. Commented Jun 8, 2017 at 17:07
  • You're right. I cannot believe I missed that. Thank you! Commented Jun 8, 2017 at 19:04
  • I know how frustrating these things can be, glad that worked :) Commented Jun 9, 2017 at 15:26

1 Answer 1

3

According to the python binding docs, it looks like the method for python is find_elements_by_class_name.

So this line:

entries = table.find_elements_by_class('rprt')

should be:

entries = table.find_elements_by_class_name('rprt')
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.