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

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

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

    泰仔在線

    java學習,心情日記,繽紛時刻
    posts - 100, comments - 34, trackbacks - 0, articles - 0

    Nutch URL過濾配置規則

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

    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/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正則:

    ?    對應     \? 

    _ (下劃張)  對應   \w 

    .(點號)    對應  \.


    轉自:nutch 最新使用日志
    主站蜘蛛池模板: 亚洲午夜精品一区二区| 亚洲尹人九九大色香蕉网站 | 久久精品国产亚洲AV麻豆不卡| xvideos亚洲永久网址| 亚洲乱妇熟女爽到高潮的片| 成人爽a毛片免费| 国产免费直播在线观看视频| 蜜芽亚洲av无码精品色午夜| 国产精品99精品久久免费| 亚洲AV成人一区二区三区AV| 久久久久国产精品免费看| 亚洲一级片免费看| 成人无码区免费A∨直播| 亚洲成a人片在线观看日本| 深夜a级毛片免费无码| 大陆一级毛片免费视频观看i| 亚洲精品乱码久久久久久蜜桃不卡 | 无限动漫网在线观看免费| 亚洲中文字幕无码中文字| 最近免费视频中文字幕大全| 国产AV无码专区亚洲AV手机麻豆| 亚洲码和欧洲码一码二码三码| 成人毛片免费在线观看| 免费一级特黄特色大片| 亚洲国产另类久久久精品小说| 99久久免费中文字幕精品| 久久亚洲国产午夜精品理论片| 花蝴蝶免费视频在线观看高清版| 久久丫精品国产亚洲av| 日本不卡在线观看免费v| 无码 免费 国产在线观看91| 久久青草亚洲AV无码麻豆| 国产免费毛不卡片| 免费大片黄在线观看| 亚洲卡一卡2卡三卡4卡无卡三| 扒开双腿猛进入爽爽免费视频| 有码人妻在线免费看片| 亚洲国产精品人久久电影| 国产一区视频在线免费观看| 青柠影视在线观看免费| 亚洲精品宾馆在线精品酒店|