Package cn.wanghaomiao.xpath.model

Examples of cn.wanghaomiao.xpath.model.JXDocument


        //轴的支持,必须接近完美
        String x11 = "//div[@id='post_list']/div[self::div/div/div/span[@class='article_view']/a/num()>1000]/div/h3/allText()";
        String x12 = "//div[@id='post_list']/div[2]/div/p/preceding-sibling::h3/allText()";
        String x13 = "//div[@id='post_list']/div[2]/div/p/preceding-sibling::h3/allText()|//div[@id='post_list']/div[1]/div/h3/allText()";
        Document doc = Jsoup.connect("http://www.cnblogs.com/").get();
        JXDocument jxDocument = new JXDocument(doc);
        List<Object> rs = jxDocument.sel(x13);
        for (Object o:rs){
            if (o instanceof Element){
                int index = ((Element) o).siblingIndex();
                System.out.println(index);
            }
View Full Code Here


//        while (line!=null){
//            line = br.readLine();
//            content.append(line);
//        }
        Document doc = Jsoup.connect("http://book.douban.com/search/java").userAgent("Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0").get();
        JXDocument jxDocument = new JXDocument(doc);
        List<Object> rs = jxDocument.sel(x16);
        for (Object o:rs){
            if (o instanceof Element){
                int index = ((Element) o).siblingIndex();
                System.out.println(index);
            }
View Full Code Here

TOP

Related Classes of cn.wanghaomiao.xpath.model.JXDocument

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.