【问题标题】:Web crawler find the whole html code网络爬虫找到整个 html 代码
【发布时间】:2014-12-15 10:23:02
【问题描述】:

请注意,我在 eclipse 和 jsoup 库中使用 java。 我的代码是:

Document doc = null;
        String crawUrl = this.getCrawlUrl();
        doc = Jsoup.connect(crawUrl).get();
        Elements hrefs2=doc.select("html");
        System.out.println(hrefs2);

我正在尝试获取特定页面的整个 html 代码,但是当 div 中有类似 div 的内容时,我没有得到它。 如何从特定页面获取整个 html 代码?

【问题讨论】:

    标签: java html jsoup web-crawler


    【解决方案1】:

    你可以试试-

    Document doc = Jsoup.connect(crawUrl).get();
    
    System.out.println(doc.toString());
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-05-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-07-14
      相关资源
      最近更新 更多