How to find the “href” of the last element?

后端 未结 1 893
半阙折子戏
半阙折子戏 2020-12-07 05:12

ImageI am trying to get the \"href\" of a particular frame which you can find in the image , i tried as much as i can but i am not able to get the \"href\"



        
1条回答
  •  不思量自难忘°
    2020-12-07 05:53

    As per the xpath you shared to get all the "href" attributes you can use the following code block :

    List list = d.findElements(By.xpath("//form[@name='form1']/table/tbody/tr[last()]/td/a"));
        for(WebElement e : list)
            System.out.println(e.getAttribute("href"));
    

    0 讨论(0)
提交回复
热议问题