Nutch 2.x没有抓取像flipkart和jabong这样的网站

时间:2014-07-13 08:15:32

标签: hbase hdfs nutch web-crawler

我已经做了一些实验,用nutch来抓取没有任何ajax调用的网站,我获得了所有数据。

我执行了以下步骤来获取数据。

  1. user @ localhost:〜/ sample / nutch / runtime / local / bin $ ./nutch inject /path/to/the/seed.txt
  2. $:./。nutch generate -batchId 321
  3. $:./。nutch fetch 321
  4. $:./。nutch parse 321
  5. $:。/ nutch updatedb
  6. 我有hbase作为存储文件在hdfs上的存储。如果我执行这5个步骤,如果网址为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>
    

1 个答案:

答案 0 :(得分:3)

regex-urlfilter阻止具有查询字符串参数的网址:

跳过包含某些字符的URL作为可能的查询等

- [?!* @ =]

修改该文件,以便抓取带有查询字符串参数的网址:

跳过包含某些字符的URL作为可能的查询等

- [!* @]

Nutch可能缺乏对抓取Ajax页面的支持。见this

你可以看看 https://issues.apache.org/jira/browse/NUTCH-1323

相关问题