【问题标题】:Nutch 2.x not crawling websites like flipkart and jabongNutch 2.x 无法抓取 Flipkart 和 jabong 等网站
【发布时间】:2014-07-13 08:15:31
【问题描述】:

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

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

  1. user@localhost:~/sample/nutch/runtime/local/bin$ ./nutch 注入 /path/to/the/seed.txt
  2. $: ./nutch 生成 -batchId 321
  3. $: ./nutch fetch 321
  4. $: ./nutch 解析 321
  5. $: ./nutch 更新b

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

【问题讨论】:

    标签: hbase hdfs nutch web-crawler


    【解决方案1】:

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

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

    -[?*!@=]

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

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

    -[*!@]

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

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

    【讨论】:

    • 谢谢它的工作,但是当我运行 nutch 时我还有一个问题,它正在获取数据但不是 html 在flipkart.com/mens-footwear/shoes/sports-shoes/… 的情况下但它给了我 html 内容在naaptol.com/brands/nokia/mobile-phones.html 的情况下让我知道你是否知道。
    • 萨钦,你必须接受别人给出的答案。你可以问尽可能多的问题。但是,如果您对那些已经回答了您的问题的人表示赞赏,那将是很好的......
    猜你喜欢
    • 1970-01-01
    • 2012-08-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-12-22
    • 1970-01-01
    相关资源
    最近更新 更多