Nutch URL过滤配置规则
nutch网上有不少有它的源码解析,但是采集这块还是不太让人容易理解.今天终于知道怎么,弄的.现在把crawl-urlfilter.txt文件贴出来,让大家一块交流,也给自己备忘录一个。
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# The url filter file used by the crawl command.
# Better for intranet crawling.
# Be sure to change MY.DOMAIN.NAME to your domain name.
# Each non-comment, non-blank line contains a regular expression
# prefixed by '+' or '-'. The first matching pattern in the file
# determines whether a URL is included or ignored. If no pattern
# matches, the URL is ignored.
# skip file:, ftp:, & mailto: urls
-^(file|ftp|mailto):
# skip image and other suffixes we can't yet parse
-\.(gif|GIF|jpg|JPG|png|PNG|ico|ICO|css|sit|eps|wmf|zip|ppt|mpg|xls|gz|rpm|tgz|mov|MOV|exe|jpeg|JPEG|bmp|BMP)$
# skip URLs containing certain characters as probable queries, etc.
//采集动态网站很重要。必须这样设置。不然像a.jsp?a=001 带有问号的网页就没办法采集。
+[?*!@=]
# skip URLs with slash-delimited segment that repeats 3+ times, to break loops
-.*(/[^/]+)/[^/]+\1/[^/]+\1/
# accept hosts in MY.DOMAIN.NAME
###########################7shop24########################################
#+^http://([a-z0-9]*\.)*7shop24.com/
#+^http://www.7shop24.com/indexdtl06.asp\?classid=([0-9]*)&productid=([0-9]*)+$
###############################http://www.redbaby.com.cn/##############################
//采集是有顺序的,不是随便写的。比如:你要采集产品页,你首先得把首页放进来,然后产品是放在分类页面的,你得把//分类也得包括进来,然后再把具体产品规则的正则写进来,这样才能完成你所需要的任务。如:
+^http://www.redbaby.com.cn/$
+^http://www.redbaby.com.cn/([a-zA-Z]*\.)*index.html$
+^http://www.redbaby.com.cn/([a-zA-Z]*)/$
+^http://www.redbaby.com.cn/([a-zA-Z]*)/index\.html+$
+^http://www.redbaby.com.cn/Product/Product_List.aspx\?Site=\d&BranchID=\d&DepartmentID=\d+$
+^http://www.redbaby.com.cn/Product/ProductInfo\w\d\w([0-9]*\.)*html$
+^http://www.redbaby.com.cn/Product/Product_List.aspx\?Site=\d&BranchID=\d&DepartmentID=\d&SortID=\d+$
+^http://www.redbaby.com.cn/Product/ProductInfo\w\d\w\d\.htm$
# skip everything else
-.
#例如采集大麦的票务信息
+^http://www.damai.cn/map.html
+^http://www.damai.cn/allticket\w\d+\.html$
-^http://item.damai.cn/(.*)aspx(.*)$
+^http://item.damai.cn/
url匹配可能用到的java正则:
? 对应 \?
_ (下划线) 对应 \w
.(点号) 对应 \.
Nutch URL过滤配置规则的更多相关文章
- Apache URL rewrite 配置
下面是Apache的配置过程,可以参考下:1.httpd.conf配置文件中加载了mod_rewrite.so模块,使用虚拟主机 #LoadModule rewrite_module modules/ ...
- DZ 3.2 URL 伪静态配置 教程
原文转自:http://www.zccode.com/thread-682-1-1.html 教程说明: 1 首先需要下载URL重写工具,拷到服务器下面安装即可,这里配置IIS7(x64)伪静态. 工 ...
- URL过滤
URL过滤 就是网址过滤.把不安全的.少儿不宜的.政治的东西过滤掉,访问这些网址就会提示受限,不能访问. 一.url过滤简介 针对企业对员工上网行为的控制管理,可以采用URL过滤技术.如企业不允许研发 ...
- dubbo之配置规则
配置规则 向注册中心写入动态配置覆盖规则 1.该功能通常由监控中心或治理中心的页面完成. RegistryFactory registryFactory = ExtensionLoader.getEx ...
- 3/19 Django框架 url路由配置及模板渲染
3/19 Django框架 url路由配置及模板渲染 1.路由分配 URL(Uniform Resoure Locato):统一资源定位符是对可以从互联网上得到的资源的位置和访问方法的一种简洁的表示, ...
- Springboot中以配置类方式自定义Mybatis的配置规则(如开启驼峰映射等)
什么是自定义Mybatis的配置规则? 答:即原来在mybatis配置文件中中我们配置到<settings>标签中的内容,如下第6-10行内容: 1 <?xml version=&q ...
- Atitit.实现反向代理(1)----url rewrite 配置and内容改写 and -绝对路径链接改写 java php
Atitit.实现反向代理(1)----url rewrite 配置and内容改写 and -绝对路径链接改写 java php 1. 代理的实现:::普通代理and反向代理?? 1 2. url ...
- quartz 时间配置规则
quartz 时间配置规则 格式: [秒] [分] [小时] [日] [月] [周] [年] 序号 说明 是否必填 允许填写的值 允许的通配符 1 秒 是 0-59 , - * / ...
- Linux iptables 配置规则
Linux iptables 防火墙配置规则 前言:把网上我感觉不错iptables的访问规则都统一在这里,以后做参考. modprobe ipt_MASQUERADE modprobe ip_con ...
随机推荐
- [转]SQL Server 2012 的 T-SQL 新功能 – 新的数据分析函数(LEAD、LAG)
当您需要在 SQL Server 中利用 T-SQL 比较结果集的每一列跟前一列或后一列的差异时,在过去可能需要利用 CURSOR 搭配临时表变量,或是透过递归 CTE 来达到这个效果,如今 SQL ...
- 略过ftp利用samba共享
开发阶段每次通过ftp上传代码到服务器是件麻烦事,而且有时候一些小错误直接通过ftp在服务器上修改后,容易忘记在本地保存. 于是想到了网络共享,windows上直接挂载网络硬盘,这样就可以略过ftp了 ...
- 网络虚拟化(SDN,NFV..)和企业骨干网的演化
本来昨天就规划了今天的这篇文章,无奈昨天中午自己喝了将近一瓶的52度二锅头...晚上想着今天怎么着也完了,要颓废难受一天了...没想到早上居然一点都不难受了.于是就写下了本文.正文之前,还是做个广告, ...
- 使用Spring MVC统一异常处理实战<转>
1 描述 在J2EE项目的开发中,不管是对底层的数据库操作过程,还是业务层的处理过程,还是控制层的处理过程,都不可避免会遇到各种可预知的.不可预知的异常需要处理.每个过程都单独处理异常,系统的代码耦合 ...
- JavaScript 闭包原理分析
本文转载至 http://www.ruanyifeng.com/blog/2009/08/learning_javascript_closures.html 另一篇很好的资料 http://www.k ...
- kafkaStream执行过程中出现TimeoutException异常退出
日志中出现以下异常信息,程序中断退出. 目前参考别人的修改下面的配置,原来使用的hostname,改成IP,再观察观察. advertised.listeners=PLAINTEXT://192.1 ...
- 监控http服务脚本
[root@ob1 scripts]# vim test_httpd.sh 1 #!/bin/bash 2 #ss -tlnup|grep :80 >/dev/null 2>&1 ...
- Maqetta源码运行
一.Maqetta简介 Maqetta是IBM开发的一个创建桌面和移动用户界面的HTML5设计编辑工具.该项目已经捐助给开源机构Dojo基金会.Maqetta提供WYSIWYG可视化HTML5用户界面 ...
- mac安装IDEA
Mac上安装Java7 首先我们需要去oracle下载最新的jdk,笔者拿到的最新的版本是1.7.0_45-b18,这里没有什么好说的,直接下载安装即可,安装完毕后需要在.bash_profile或者 ...
- [oracle] 如何使用myBatis在数据库中插入数据并返回主键
在MyBatis中,希望在Oracle中插入数据的同时返回主键值,而非插入的条数. ① oracle使用 selectKey. U_USER_INFO_SEQ 是在数据库中定义好的这张表关联的序列se ...