<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    泰仔在線

    java學(xué)習(xí),心情日記,繽紛時刻
    posts - 100, comments - 34, trackbacks - 0, articles - 0

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

    Posted on 2010-04-30 10:12 泰仔在線 閱讀(3385) 評論(0)  編輯  收藏 所屬分類: 云計算相關(guān)

    nutch網(wǎng)上有不少有它的源碼解析,但是采集這塊還是不太讓人容易理解.今天終于知道怎么,弄的.現(xiàn)在把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.

    //采集動態(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/Product_List.aspx\?Site=\d&BrandID=\d&BranchID=\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
    -.

     

     

    url匹配可能用到的java正則:

    ?    對應(yīng)     \? 

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

    .(點號)    對應(yīng)  \.


    轉(zhuǎn)自:nutch 最新使用日志
    主站蜘蛛池模板: 国产特黄一级一片免费| 亚洲国产精品成人综合色在线婷婷| 亚洲人成网站18禁止| 9久9久女女免费精品视频在线观看| 亚洲欧洲自拍拍偷午夜色| 天天影院成人免费观看| 亚洲国产成人久久综合一区| 免费视频爱爱太爽了| va天堂va亚洲va影视中文字幕| 中文字幕无码免费久久99| 亚洲av无码电影网| 日韩激情淫片免费看| 日韩毛片免费一二三| 亚洲日韩乱码中文无码蜜桃臀网站| A片在线免费观看| 精品日韩亚洲AV无码| 成人女人A级毛片免费软件| 亚洲熟妇av午夜无码不卡 | 亚洲理论片在线观看| 国产四虎免费精品视频| 亚洲午夜成人精品无码色欲| 国产区卡一卡二卡三乱码免费| 羞羞视频在线观看免费| 亚洲成A人片在线观看WWW| 999任你躁在线精品免费不卡| 亚洲精品亚洲人成在线播放| 国产免费观看视频| AAAAA级少妇高潮大片免费看| 亚洲福利在线观看| 永久免费AV无码网站在线观看| 亚洲一区二区三区免费| 337p日本欧洲亚洲大胆艺术| 日本一区免费电影| 最新国产乱人伦偷精品免费网站| 亚洲成a人片毛片在线| 免费二级毛片免费完整视频| 99精品视频在线免费观看| 九九精品国产亚洲AV日韩| 亚洲av永久无码精品漫画| 国产精品国产午夜免费福利看| 天堂在线免费观看|