nutch如何才能抓取到动态的url,配置文件解析

Nutch默认配置可能忽略包含特殊字符如?*!@=的URL。要抓取动态URL,需修改crawl-urlfilter.txt文件中的过滤规则。例如,将-[?*!@=]改为-[~]。此外,配置还包括针对特定域名的过滤,如论坛Discuz的板块列表和帖子内容。其他配置文件如nutch-default.xml和regex-urlfilter.txt也会影响爬虫行为。
摘要由CSDN通过智能技术生成

在运行的时候不会抓取到,分析了一下原因:主要在conf/crawl-urlfilter.txt.
分析:使用nutch默认的配置过滤文件的话,是不抓取到包含?*!@=等字符的URL
解决办法:修改crawl-urlfilter的过滤规则,

# 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.
-[?*!@=]  

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值