4
我用nutch做了一些实验来抓取没有任何ajax调用的网站,并且我得到了所有的数据。Nutch 2.x没有抓取像flipkart和jabong这样的网站
我执行以下步骤来获取数据。
- 用户@本地:〜/样品/ Nutch的/运行/ local/bin目录$ ./nutch注入/path/to/the/seed.txt
- $:./nutch产生-batchId 321
- $:./nutch取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>
感谢的人它的工作原理,但我当我运行Nutch的是你获得的数据,但在HTTP的情况下,而不是HTML多了一个问题://www.flipkart。 com /男装鞋/鞋/运动鞋/ pr?sid = osp,cil,nit,1cu&otracker = hp_nmenu_sub_men_0_Sports%20鞋子,但它给我的html内容http://www.naaptol.com/brands/nokia/ mobile-phones.html让我知道,如果你知道的东西。 – saching
Sachin,你必须接受别人给出的答案。你可以根据你的需要询问很多问题。但是,如果你给那些已经回答你的问题的人提供一些信用,这将会很好。 –