我想提取jsoup中给定元素内的链接。在这里我做了什么,但它不工作:Java jsoup链接提取
Document doc = Jsoup.connect(url).get();
Elements element = doc.select("section.row");
Element s = element.first();
Elements se = s.getElementsByTag("article");
for(Element link : se){
System.out.println("link :" + link.select("href"));
}
我试图做的事情是让所有withing文章类的链接。我认为也许首先我必须选择section =“row”部分,然后在那之后从文章类中获取链接,但是我无法使其工作。
你会得到什么结果? – GHajba
上面的代码给出了任何结果,当我试图打印元素时,它向我展示了与图像 – imoteb