我用 nutch 做了一些实验来抓取没有任何 ajax 调用的网站,我得到了所有的数据。
我执行了以下步骤来获取数据。
我有 hbase 作为在 hdfs 上存储文件的存储。如果我执行这 5 个步骤,如果 url 是 http://www.naaptol.com/brands/nokia/mobile-phones.html,它会为我提供所有数据。但如果我把它改成 http://www.flipkart.com/mens-footwear/shoes/sports-shoes/pr?sid=osp,cil,nit,1cu&otracker=hp_nmenu_sub_men_0_Sports%20Shoes它什么也没给我
我的 nutch-site.xml 文件:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
<name>storage.data.store.class</name>
<value>org.apache.gora.hbase.store.HBaseStore</value>
<description>Default class for storing data</description>
</property>
<property>
<name>http.agent.name</name>
<value>com.datametica.agent</value>
<description>this is just an agent name</description>
</property>
<property>
<name>http.robots.agents</name>
<value>datametica_robot</value>
<description>this is just a robot</description>
</property>
<property>
<name>plugin.folders</name>
<value>/home/sachin/source_codes/svn/nutch/nutch_2.x/build/plugins</value>
</property>
</configuration>
最佳答案
regex-urlfilter 阻止具有查询字符串参数的 url:
跳过包含某些字符的 URL 作为可能的查询等。
-[?*!@=]
修改该文件,以便抓取带有查询字符串参数的 url:
跳过包含某些字符的 URL 作为可能的查询等。
-[*!@]
Nutch 可能缺乏对抓取 Ajax 页面的支持。见 this
你大概可以看看
https://issues.apache.org/jira/browse/NUTCH-1323
关于hbase - Nutch 2.x 不能抓取像flipkart 和jabong 这样的网站,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24720760/