开发者

how to crawl a specific URL using nutch 1.2

I'm using nutch-1.2 but not able to restrict my config file to crawl only given urls

my crawl-urlfilter.txt file is

    # 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|js|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 co开发者_如何学Gontaining certain characters as probable queries, etc.
    -[?*!@=]

    # skip URLs with slash-delimited segment that repeats 3+ times, to break loops
    -.*(/[^/]+)/[^/]+\1/[^/]+\1/

 # accept hosts in MY.DOMAIN.NAME
    -.*
    +^http://([a-z0-9]*\.)abc.com/[0-9].*[a-z]*.html$
    -^http://([a-z0-9]*\.)*abc.com/[-a-z/]*/$
    -^http://([a-z0-9]*\.)*abc.com/[-a-z]*.php$

Thanks


I thought that I read somewhere, that this config is evaluated from top to bottom.

And since the

-. 

matches everything - nutch will ignore the further entries. My crawl-urlfilter.txt looks something like that at the bottom (in exactly that order) and is working pretty well:

# accept hosts in MY.DOMAIN.NAME
+^http://localhost:8080/

# skip everything else
-.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜