Image here 我正在尝试获取您可以在图像中找到的特定框架的“href”,我已尽我所能,但无法获取“href”
List<WebElement> list=d.findElements(By.xpath(".//*[@id='collegeFilter']/div/div/div/div/div/div[13]/div"));
for(WebElement e : list){
String link = e.getAttribute("href");
System.out.println(link);
我尝试了上面的代码,我获取了该帧的 Xpath 并尝试获取该帧的 href。链接:http://freevideolectures.com/Subject/Business-Management [图片]
最佳答案
要获取页面底部页码的“href”
属性,您可以使用以下代码块:
List<WebElement> list = d.findElements(By.xpath("//ul[@class='pagination']/li/a"));
for(WebElement e : list)
System.out.println(e.getAttribute("href"));
关于java - 如何找到<ul>特定帧的 "href"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47330502/