• 大小: 273KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-19
  • 语言: Java
  • 标签: 爬虫  java  java爬虫  

资源简介

一个简单的百度贴吧java爬虫,可以爬取用户内容,用户名和楼层

资源截图

代码片段和文件信息

package com.wuxin.data;

import java.io.IOException;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

public class PostBar {

public static Document GetHtml() throws IOException 
{
Document doc = Jsoup.connect(“http://tieba.baidu.com/f?ie=utf-8&kw=%E6%A1%82%E6%9E%97%E7%90%86%E5%B7%A5%E5%A4%A7%E5%AD%A6“)//+page)

            .userAgent(  
                        “Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.2.15)“)
                         
            .timeout(5000)
            .get();

return doc; 

}
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-12-07 20:32  SpliderDemo3\
     文件         357  2015-12-07 20:35  SpliderDemo3\.classpath
     文件         388  2015-12-07 20:31  SpliderDemo3\.project
     目录           0  2015-12-07 20:31  SpliderDemo3\.settings\
     文件         598  2015-12-07 20:35  SpliderDemo3\.settings\org.eclipse.jdt.core.prefs
     目录           0  2015-12-07 20:35  SpliderDemo3\bin\
     目录           0  2015-12-07 20:35  SpliderDemo3\bin\com\
     目录           0  2015-12-08 08:27  SpliderDemo3\bin\com\wuxin\
     目录           0  2015-12-09 14:55  SpliderDemo3\bin\com\wuxin\data\
     文件         869  2015-12-09 15:01  SpliderDemo3\bin\com\wuxin\data\PostBar.class
     目录           0  2015-12-08 10:44  SpliderDemo3\bin\com\wuxin\main\
     文件        2132  2015-12-09 15:01  SpliderDemo3\bin\com\wuxin\main\Page.class
     文件        2591  2015-12-09 15:01  SpliderDemo3\bin\com\wuxin\main\Teste.class
     目录           0  2015-12-07 20:32  SpliderDemo3\lib\
     文件      297387  2014-04-09 11:35  SpliderDemo3\lib\jsoup-1.7.3.jar
     目录           0  2015-12-07 20:32  SpliderDemo3\src\
     目录           0  2015-12-07 20:32  SpliderDemo3\src\com\
     目录           0  2015-12-08 08:27  SpliderDemo3\src\com\wuxin\
     目录           0  2015-12-09 14:55  SpliderDemo3\src\com\wuxin\data\
     文件         568  2015-12-09 15:01  SpliderDemo3\src\com\wuxin\data\PostBar.java
     目录           0  2015-12-08 10:44  SpliderDemo3\src\com\wuxin\main\
     文件        1091  2015-12-09 15:01  SpliderDemo3\src\com\wuxin\main\Page.java
     文件        1728  2015-12-09 15:01  SpliderDemo3\src\com\wuxin\main\Teste.java

评论

共有 条评论