nutch2.1抓取中文网站
A、调整mysql配置,避免存入mysql的中文出现乱码。修改 ${APACHE_NUTCH_HOME} /runtime/local/conf/gora.properties
###############################
# MySQL properties #
###############################
gora.sqlstore.jdbc.driver=com.mysql.jdbc.Driver
gora.sqlstore.jdbc.url=jdbc:mysql://10.10.11.252:3306/nutch? useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull
gora.sqlstore.jdbc.user=devuser
gora.sqlstore.jdbc.password=devuser
B、修改 ${APACHE_NUTCH_HOME} /runtime/local/conf/nutch-site.xml文件
<property>
<name>http.accept.language</name>
<value>ja-jp, en-us, zh-cn,en-gb,en;q=0.7,*;q=0.3</value>
<description>Value of the “Accept-Language” request header field.
This allows selecting non-English language as default one to retrieve.
It is a useful setting for search engines build for certain national group.
</description>
</property>
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。