网页手动采集之内涵吧内涵段子手动采集

优采云 发布时间: 2020-08-09 15:29

  内涵吧内涵段子采集入口类Neihan8Crawl这儿的没有实现抓取程序的周期性采集,这里可以依照自己的须要来写相应的线程。

<p> /**

*@Description:

*/

package cn.lulei.crawl.neihan8;

import java.io.IOException;

import java.util.ArrayList;

import java.util.HashSet;

import cn.lulei.db.neihan8.Neihan8DbOperation;

import cn.lulei.model.Neihan8;

import cn.lulei.util.ParseUtil;

import cn.lulei.util.ThreadUtil;

public class Neihan8Crawl {

//内涵吧更新列表页url格式

private static String listPageUrl = "http://www.neihan8.com/article/list_5_%pno%.html";

//两次访问页面事件间隔,单位ms

private static int sleepTime = 500;

/**

* @param start 起始页

* @param end 终止页

* @throws IOException

* @Date: 2014-2-13

* @Author: lulei

* @Description: 抓取更新列表页上的内容

*/

public void crawlMain(int start, int end) throws IOException{

start = start < 1 ? 1 : start;

Neihan8DbOperation neihan8DbOperation = new Neihan8DbOperation();

for ( ; start

0 个评论

要回复文章请先登录注册


官方客服QQ群

微信人工客服

QQ人工客服


线