亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

Nutch URL過濾配置規(guī)則

系統(tǒng) 1573 0

nutch網(wǎng)上有不少有它的源碼解析,但是采集這塊還是不太讓人容易理解.今天終于知道怎么,弄的.現(xiàn)在把crawl-urlfilter.txt文件貼出來,讓大家一塊交流,也給自己備忘錄一個(gè)。

?

# 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.

//采集動(dòng)態(tài)網(wǎng)站很重要。必須這樣設(shè)置。不然像a.jsp?a=001 帶有問號的網(wǎng)頁就沒辦法采集。
+[?*!@=]

# 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/##############################

?

//采集是有順序的,不是隨便寫的。比如:你要采集產(chǎn)品頁,你首先得把首頁放進(jìn)來,然后產(chǎn)品是放在分類頁面的,你得把//分類也得包括進(jìn)來,然后再把具體產(chǎn)品規(guī)則的正則寫進(jìn)來,這樣才能完成你所需要的任務(wù)。如:
+^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
-.

?#例如采集大麥的票務(wù)信息

+^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正則:

???? 對應(yīng) ??? \??

_ (下劃線)? 對應(yīng)?? \w?

.(點(diǎn)號)??? 對應(yīng)? \.

?

Nutch URL過濾配置規(guī)則


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯(lián)系: 360901061

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長非常感激您!手機(jī)微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會(huì)非常 感謝您的哦!!!

發(fā)表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 久久aa毛片免费播放嗯啊 | 99精品国产自产在线观看 | 久久久国产麻豆 | 高h粗大强行撑开紧窄的嫩缝 | 色综七七久久成人影 | 欧美性xxx免费看片 欧美性白人顶级hd 欧美性插视频 | 国产自愉怕一区二区三区 | 午夜激情婷婷 | 亚洲精品在线观看视频 | 狠狠躁夜夜躁人人爽天天天天 | 成人欧美一区二区三区在线观看 | 中文字幕久久综合 | 亚洲欧美在线观看一区二区 | 人成精品视频三区二区一区 | 香蕉视频在线视频 | 四虎免费永久网站入口 | 久久精品中文字幕第一页 | 日本一级特黄aa大片24免费 | 桃花福利视频在线观看 | 国产精品一国产精品免费 | 国产亚洲一级精品久久 | 亚洲欧洲第一页 | 日本一级毛片视频网站 | 成年女人视频播放免费观看 | 国产精品久久久久无码av | 色琪琪永久远网址 | 日本aⅴ永久免费网站www | 一级成人| 狠狠色噜噜狠狠狠米奇9999 | 婷婷四房综合激情五月性色 | 偷偷狠狠的日日2020 | 欧美观看一级毛片 | 纯欧美一级毛片免费 | 久久综合久久鬼 | 成人影视在线观看 | 天天操天天摸天天舔 | 天天插狠狠干 | 亚洲国产日本 | 老色鬼久久综合第一 | 亚洲欧洲日本精品 | 狠狠综合视频精品播放 |