selenium how to get the content of href within some targeted class

后端 未结 3 1538
北荒
北荒 2020-12-05 13:39

I am trying to retrieve the data from the webpage has the html in below

       
      
3条回答
  •  有刺的猬
    2020-12-05 14:28

    This should do it for you:

    self.driver.find_element_by_css_selector('.someclass a').get_attribute('href')
    

提交回复
热议问题