Clicking on a link via selenium

后端 未结 4 1905
野性不改
野性不改 2020-12-05 17:40

I am trying to do some webscraping via Selenium. My question is very simple: How do you find a link and then how do you click on it? For instance: The following is the HTM

4条回答
  •  没有蜡笔的小新
    2020-12-05 18:10

    You can try to click link by using xpath locator e.g.

    link=driver.find_element_by_xpath(.//*[@id="content"]/div[3]/div/div/div[2]/h4)
    
    link.click()
    

提交回复
热议问题