Document doc = JSoup.parse(googleURL); doc.select("cite") //to get all the cite elements in the page doc.select("li > cite") //to get all the <cites>'s that only exist under the <li>'s doc.select("li.g cite") //to only get the <cite> tags under <li class=g> tags public static void main(String[] args) throws IOException { String html = getHTML(); Document doc = Jsoup.parse(html); Elements elems = doc.select("li.g > cite"); for(Element elem: elems){ System.out.println(elem.toString()); } }
一个号网站
JSoup QUERY
最新推荐文章于 2024-08-11 22:04:26 发布