JSoup QUERY

来源:互联网 发布:光环大数据坑吗 编辑:程序博客网 时间:2024/06/05 05:03

Document doc = JSoup.parse(googleURL);doc.select("cite") //to get all the cite elements in the pagedoc.select("li > cite") //to get all the <cites>'s that only exist under the <li>'sdoc.select("li.g cite") //to only get the <cite> tags under <li class=g> tagspublic 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()); }}

 

一个号网站

http://www.oschina.net/question/12_14127

0 0
原创粉丝点击