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

后端 未结 3 1546
北荒
北荒 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:18

    As far as I am aware you can get the href by searching through the child elements

    div = self.driver.find_element_by_class_name('someclass')
    div.find_element_by_css_selector('a').get_attribute('href')
    

提交回复
热议问题