Clicking on a link via selenium

后端 未结 4 1899
野性不改
野性不改 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:09

    Then you can try something like this.

    for (int i=0; i<td.length(); i++){
            driver.find_element_by_xpath("(//a[contains(text(),'Details')])[i]").click()
            }
    

提交回复
热议问题