元素中的硒发现元素

时间:2017-06-08 17:01:48

标签: python selenium web-scraping

我知道这个问题之前似乎已被问过,但是当我尝试模仿对他人有用的回复时,仍然存在问题。

我的代码是:

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

我正在

  

AttributeError:'WebElement'对象没有属性   'find_element_by_class'

链接到网页:https://www.ncbi.nlm.nih.gov/clinvar/?term=setx%5Bgene%5D

1 个答案:

答案 0 :(得分:0)

根据the python binding docs,看起来python的方法是find_elements_by_class_name

所以这一行:

entries = table.find_elements_by_class('rprt')

应该是:

entries = table.find_elements_by_class_name('rprt')
相关问题