hbase - Nutch 2.x 不能抓取像flipkart 和jabong 这样的网站

标签 hbase hdfs nutch web-crawler

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

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

  • user@localhost:~/sample/nutch/runtime/local/bin$ ./nutch injection/path/to/the/seed.txt
  • $: ./nutch generate -batchId 321
  • $: ./nutch fetch 321
  • $: ./nutch 解析 321
  • $: ./nutch updatedb

  • 我有 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/

    相关文章:

    Hbase 错误。 org.apache.hadoop.hbase.client.RetriesExhaustedException : Failed after attempts=10, 异常

    hadoop - 是否可以将hbase行键设置在何处?

    java - 如何以编程方式在 hdfs 中创建/触摸文件?

    nutch - 我在哪里可以找到有关 Nutch 状态代码的文档?

    solr - 如何通过指定深度来抓取网站

    hadoop - 为什么使用 MapReduce 与 HBase shell 过滤器

    hadoop - HBase表批量加载详细步骤

    hadoop - MapReduce架构

    hadoop - 如何理解文件读写过程中的 "hdfs client"?

    hadoop - 安装 Nutch 1.3 和 Hadoop