MinerUtil.java 爬虫工具类

MinerUtil.java 爬虫工具类

package com.iteye.injavawetrust.miner;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TimeZone;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

/**
 * 爬虫工具类
 * @author InJavaWeTrust
 *
 */
public class MinerUtil {
	
	private static final Log LOG = LogFactory.getLog(MinerUtil.class);
	
	public static long starTime = 0;
	
	/**
	 * 判断是否为空
	 * @param param
	 * @return true-为空;false-非空
	 */
	public static boolean isBlank(String param) {
		return (null == param || "".equals(param.trim())) ? true : false;
	}
	
	/**
	 * URL是否以html结尾
	 * @param url
	 * @return true-是;false-否
	 */
	public static boolean checkURL(String url) {
		String html = url.substring(url.lastIndexOf(".") + 1);
		return "html".equals(html) ? true : false;
	}
	/**
	 * URL列表是否包含关键字
	 * @param key 关键字
	 * @param keys URL列表
	 * @return true-是;false-否
	 */
	public static boolean checkKeys(String key, List<String> keys) {
		boolean flag = false;
		for(String k : keys) {
			if(key.contains(k)){
				flag = true;
				break;
			}
		}
		return flag;
	}
	
	public static boolean isValidFileName(String fileName) {
		if (fileName == null || fileName.length() > 255){
			return false;
		} else {
			return fileName
					.matches("[^\\s\\\\/:\\*\\?\\\"<>\\|](\\x20|[^\\s\\\\/:\\*\\?\\\"<>\\|])*[^\\s\\\\/:\\*\\?\\\"<>\\|\\.]$");
		}
	} 
	
	/**
	 * 获取URL
	 * @param url URL
	 * @return URL
	 */
	public static Set<String> getAllUrl(String url){
		Set<String> urls = new HashSet<String>();
		try {
			Connection conn = Jsoup.connect(url);
			conn.header("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13");//模拟浏览器  
			Document document = conn.timeout(5000).get();
			Elements hrefs = document.select("a[href]");
			Iterator<Element> hrefIter = hrefs.iterator();
			while (hrefIter.hasNext()) {
				Element href = hrefIter.next();
				urls.add(href.attr("href"));
			}
		} catch (Exception e) {
			LOG.info("获取URL出现异常,异常URL[" + url + "]");
			LOG.info("异常信息[" + e.getMessage() + "]");
		}
		return urls;
	}
	
	/**
	 * 毫秒转换成hhmmss
	 * @param ms 毫秒
	 * @return hh:mm:ss
	 */
	public static String msToss(long ms) {
		SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
		formatter.setTimeZone(TimeZone.getTimeZone("GMT+00:00"));
		String ss = formatter.format(ms);
		return ss;
	}
	
	/**
	 * 将html写入本地文件
	 * @param htmlText html内容
	 * @param htmlName html名称
	 */
	public static void getHtmlToLocal(Map<String, String> map){
		Writer writer = null;
		try {
			String path = MinerConstanits.HTMLPATH + getToday();
			makeDir(path);
			writer = new OutputStreamWriter(new FileOutputStream(new File(path
					+ File.separator + map.get("title"))), "UTF-8");
			writer.write(map.get("html"));
			writer.flush();
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			if (writer != null) {
				try {
					writer.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}
	}
	/**
	 * 文件名不能包含下列任何字符:<br>
	 * \/:*?"<>|
	 * @param title 标题
	 * @return 去掉文件名不能包含的字符
	 */
	public static String fileName(String title){
		return title
				.replaceAll("\\\\", "")
				.replaceAll("/", "")
				.replaceAll(":", "")
				.replaceAll("\\*", "")
				.replaceAll("\\?", "")
				.replaceAll("\"", "")
				.replaceAll("<", "")
				.replaceAll(">", "")
				.replaceAll("\\|", "");
	}
	/**
	 * 获取当天日期
	 * @return 当天日期
	 */
	public static String getToday(){
		String result = "";
		Date date = new Date();
		result = format(date);
		return result;
	}
	/**
	 * 格式化日期
	 * @param date 日期
	 * @return yyyymmdd 日期
	 */
	public static String format(Date date){
		String format = "yyyyMMdd";
		SimpleDateFormat fmt = new SimpleDateFormat(format);
		return fmt.format(date);
	}
	/**
	 * 创建存储目录
	 * @param path 存储目录
	 */
	public static void makeDir(String path) {
		File file = new File(path);
		if(!file.exists()){
			file.mkdirs();
			LOG.info("创建存储目录[" + path + "]");
		}
	}
	
	public static boolean checkBeforeStart(MinerConfig config) {
		if(null == config){
			LOG.info("config未配置!!!");
			return false;
		}
		if(null == config.getKeys() || 0 == config.getKeys().size()){
			LOG.info("包含关键字未配置!!!");
			return false;
		}
		if(null == config.getStoreType()){
			LOG.info("存储方式未配置!!!");
			return false;
		}
		if(config.getMaxDepth() < 1){
			LOG.info("爬取页面最大深度配置错误!!!");
			return false;
		}
		if(config.getMinerHtmlThreadNum() < 1){
			LOG.info("下载页面线程数配置错误!!!");
			return false;
		}
		if(config.getMiseringThreadNum() < 1){
			LOG.info("分析页面线程数配置错误!!!");
			return false;
		}
		if(config.getMinserStoreThreadNum() < 1){
			LOG.info("存储线程数配置错误!!!");
			return false;
		}
		return true;
	}
	
	public static void main(String[] args) {
		String path = MinerConstanits.HTMLPATH + File.separator + getToday();
		makeDir(path);
//		System.out.println(getToday());
//		String test = "http://my.163.com/2015/11/27/17763_578935.html";
//		System.out.println(fileName(test));
//		System.out.println(MinerUtil.isBlank(null));
//		System.out.println(MinerUtil.isBlank(""));
//		System.out.println(MinerUtil.isBlank(" "));
//		System.out.println(MinerUtil.isBlank("bbb"));
//		System.out.println(MinerUtil.isBlank(" bbb "));
		
//		String key = "http://www.jqu.net.cn";
//		List<String> keys = new ArrayList<String>();
//		keys.add("http://www.jqu.net.cn");
//		System.out.println(MinerUtil.checkKeys(key, keys));
	}

}

 

返回列表

 

双轴按键摇杆模块原理与嵌入式驱动实战 双轴按键摇杆是一种融合模拟量(X/Y轴)与数字量(Z轴按键)的复合型人机交互传感器,其本质基于电位器分压原理与机械开关通断特性。通过ADC采集连续电压信号并结合数字IO检测按键状态,可实现高鲁棒性的二维运动感知与触发控制。该方案技术门槛低、成本可控、兼容性强,广泛应用于智能小车、DIY游戏手柄、工业HMI及教育开发板等嵌入式场景。文中深入解析电位器线性度、KEY引脚开漏特性、ADC参考电压稳定性及软件消抖状态机等关键工程要素,为基于Arduino、STM32或ESP32平台的快速集成提供可复用的技术路径。 阅读详情

相关推荐

CMOS传输门实战:如何用模拟开关优化你的电路设计(附常见问题排查)

本文深入探讨了CMOS传输门在电路设计中的实战应用与优化策略。文章从核心参数选型入手,详细分析了导通电阻、电荷注入等关键特性对电路性能的影响,并提供了多路复用器构建、精密电路应用等实战架构。同时,重点分享了PCB布局、电源去耦的工程细节,以及开关不导通、信号失真、高频性能不足等常见问题的系统性排查指南,旨在帮助硬件工程师充分发挥CMOS模拟开关的效能,提升电路设计的可靠性与精度。

js777的博客 451

Java 爬虫

Web Magic 封装了 SpiderMonitor、SpiderStatusMXBean 用于监控爬虫状态//爬虫名称,即爬虫的uuid,唯一标识一个爬虫//待爬取的url数量//启动爬虫,实质是调用 spider.start()//终止爬虫,实质是调用 spider.stop()SpiderMonitor 很多方法是 protected 的,不能直接调用,需要通过 jconsole 之类的 JMX 客户端来查看爬虫状态,使用不方便。

chy-x 的博客 3293

保姆级教程:用Adams/Car和Simulink搞定你的第一个整车联合仿真(附模型文件)

本文提供了一份详尽的Adams/Car与Simulink联合仿真教程,涵盖从环境配置到模型导出的全流程。通过实战案例解析,帮助工程师快速掌握多体动力学仿真与控制算法开发的集成技术,特别适合汽车工程领域的初学者。文章还包含常见问题解决方案和性能优化建议,助您高效完成整车联合仿真项目。

weixin_29663861的博客 338

Java爬虫的几种方式

爬虫(Web crawler)是一种自动化程序,用于浏览互联网并收集网页数据。它可以按照预定的规则自动访问网页、提取数据,并将数据存储到本地或其他目标位置。爬虫通常用于搜索引擎、数据挖掘、信息收集、监测等应用。爬虫的基本工作原理是模拟人类在浏览器中访问网页的过程。它发送HTTP请求到目标网站,并获取返回的HTML或其他类型的响应。然后,爬虫解析HTML响应,提取出需要的信息,如链接、文本、图像等。这些信息可以进一步处理、存储或分析。

qq_45506362的博客 1万+

OV5640调试大坑,关于binning、RES分辨率与EV曝光

OV5640在使用binning模式时,必须考虑使用场景,分辨率下降叠加动态范围压缩,会使目标对象细节在高光环境下大量丢失,2x2的binning模式,分辨率会远低于感光面积的1/4。

chongyun_的专栏 1829

DSP篇--C6678功能调试系列之SPI调试

SPI传输数据分为线上直接收发和通过EDMA的数据传输两种。第一种是直接将数据放在线上(SPIDAT1),在寄存器(SPIBUF)中写入命令实现数据的收发;第二种需要配置EDMA,将数据buffer直接作为EDMA的数据源进行传输,其需要配置的参数和中断与EDMA一致。

nanke_yh的博客 1261

00. 这里整理了最全的爬虫框架(Java + Python)

网络爬虫技术在信息时代的大数据时代中变得越来越重要。它是一种从互联网上获取数据的技术,被广泛应用于搜索引擎、数据挖掘、商业情报等领域。

有一只柴犬的专栏 7141

Apollo 9.0 参考线生成器 -- ReferenceLineProvider

在基于参考线的规划算法中,参考线是Planning一切工作的基础和前提,所以搞清楚参考线怎么来的就变得很重要。为此,首先需要了解Planning 与 Routing的交互,通过交互得到路径片段,这些路径片段就告诉我们该怎么走,再在此基础上生成参考线,最后使用不同的平滑算法对参考线进行平滑,得到一条光滑的参考线。

WaiNgai 1666

【Java】爬虫

来黑马程序员学习Java,手机号:18512516758,18512508907或者联系邮箱:boniu@itcast.cn,座机电话:01036517895,010-98951256邮箱:bozai@itcast.cn,热线电话:400-618-9090 ,400-618-4000,4006184000,4006189090。既然座机电话,邮箱,手机号你都想要,第一件事就得把座机电话,邮箱,手机号的正则表达式写出来。需求:把下面文本中的座机电话,邮箱,手机号,热线都爬取出来。

qq_39921135的博客 4667

快速傅里叶变换(FFT)的汇编实现在DSP开发中

在数字信号处理(Digital Signal Processing,DSP)开发中,使用汇编语言实现FFT可以进一步提高计算性能和优化系统资源的使用。FFT是一种分治算法,它通过将一个长度为N的离散时间域序列分解为多个长度为N/2的子序列,然后递归地进行计算。开发者可以根据实际需求,结合具体的硬件平台和编译器工具链,对FFT的汇编实现进行优化和定制化。需要注意的是,上述示例代码中只给出了FFT的基本框架,具体的合并操作及其他细节需要根据实际需求进行实现。上述示例代码演示了一个简单的FFT汇编实现。

QoTypescript的博客 683

FOC 转子初始位置检测(图文详解)

什么是转子的初始位置? 其实转子的初始位置是不确定的,但是在电机启动的时候,我们需要得到电角度,这样才可以进行矢量控制;所以,这里将转子与A轴重合作为初始位置,此时电角度也恰好为零,具体如下图所示; ) 至于原理下面会详细分析,这样在转子到初始位置后,也可以得到准确的电角度,就可以实现磁场和转子的同步转动。 如何让转子运行到初始位置? 其实这是一个很简单的问题,在这里我将它放大了,简单地分析了一...

一名热爱技术的工程师的博客。分享技术干货,记录美好生活。永远相信美好的事情即将发生。 2万+

java爬虫技术工具类_MinerUtil.java 爬虫工具类

package com.iteye.injavawetrust.miner;import java.io.File;import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.IOException;import java.io.OutputStreamWriter;import java....

weixin_42196279的博客 127

芒果YOLO11改进21:检测头Head篇:即插即用|新颖轻量化非对称多级压缩LADH检测头,原创改进适配YOLOv8高效检测头,检测头新颖性改进,全网首发独一份

检测头Head篇:即插即用|新颖轻量化非对称多级压缩LADH检测头,原创改进适配YOLOv8高效检测头,检测头新颖性改进,全网首发独一份

包括YOLOv5、YOLOv7、YOLOv8等模型改进 795

Miner.java 爬虫启动类

Miner.java 爬虫启动类 package com.iteye.injavawetrust.miner; import java.util.concurrent.ThreadPoolExecutor; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** *...

14万+

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

MinerHtmlThread.java 爬取页面线程

MinerHtmlThread.java 爬取页面线程 package com.iteye.injavawetrust.miner; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.jsoup.Connection; import org.j...

weixin_30682127的博客 76

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

MiseringThread.java 解析页面线程

MiseringThread.java 解析页面线程 http://injavawetrust.iteye.com package com.iteye.injavawetrust.miner; import java.util.Set; import org.apache.commons.logging.Log; import org.apache.commons.logging....

weixin_30872867的博客 77

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

19款Java开源Web爬虫

网络爬虫(又被称为网页蜘蛛,网络机器人,在FOAF社区中间,更经常的称为网页追逐者),是一种按照一定的规则,自动地抓取万维网信息的程序或者脚本。另外一些不常使用的名字还有蚂蚁、自动索引、模拟程序或者蠕虫。 今天将为大家介绍19款Java开源Web爬虫,需要的小伙伴们赶快收藏吧。 一、Heritrix  Heritrix 是一个由 java 开发的、开源的网络爬虫,用户可以

u013406800的专栏 588

Java爬虫工具大全

HttpClient:一个开源的HTTP客户端库,可用于发送HTTP请求和接收HTTP响应。Nutch:一个开源的Java爬虫框架,可用于爬取大规模的网页并建立搜索引擎。Crawler4j:一个开源的Java爬虫框架,可用于爬取网页并提取数据。Jsoup:一个开源的Java HTML解析器,可用于从网页中提取数据。WebMagic:一个开源的Java爬虫框架,可用于快速开发爬虫程序。Jaunt:一个商业化的Java爬虫库,可用于爬取网页并提取数据。

小龙在线 964

Java爬虫入门——HttpClient,JSoup

爬虫也叫网络机器人,可以代替人工,自动的在网络上采集和处理信息。爬虫包括数据采集,分析,存储三部爬虫引入依赖--引入httpClient依赖-->

qq_52655865的博客 1598

Java爬虫①HttpClient

HttpClient是Apache中一个开源的项目,用来提供高效的,最新的,功能丰富的支持HTTP协议的客户端编程工具包,并且它支持HTTP协议最新版本和建议。 引入依赖 <dependencies> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifact

weixin_46083166的博客 358

Jsoup爬虫之Java爬虫工具类

Jsoup爬虫之Java爬虫工具类 正文 1.导入依赖 <!-- jsoup爬虫依赖--> <dependency> <groupId>org.jsoup</groupId> <artifactId>jsoup</artifactId> <version>1.10.2</version> <

Junnix的博客 1977

Java爬虫

为什么我们要爬取数据 在大数据时代,我们要获取更多数据,就要进行数据的挖掘、分析、筛选,比如当我们做一个项目的时候,需要大量真实的数据的时候,就需要去某些网站进行爬取,有些网站的数据爬取后保存到数据库还不能够直接使用,需要进行清洗、过滤后才能使用,我们知道有些数据是非常真贵的。 分析豆瓣电影网站 我们使用Chrome浏览器去访问豆瓣的网站如 https://movie.douban.com/exp...

技术无止境 12万+
上一篇: MinerUrl.java 解析页面后存储URL类
下一篇: MiseringThread.java 解析页面线程
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值