请求身份验证的爬网网站

时间:2014-08-07 13:33:28

标签: nutch web-crawler

我按照此https://wiki.apache.org/nutch/HttpAuthenticationSchemes链接通过提供用户名和密码来抓取少数网站

解决方法:我在httpclient-auth.xml文件中设置了auth-configuration:

<auth-configuration>
<credentials username="xyz" password="xyz">
<default realm="domain" />
<authscope host="www.gmail.com" port="80"/>
</credentials>
</auth-configuration>

ii)在nutch-site.xml和nutch-default.xml

中定义httpclient属性
<property>
<name>plugin.includes</name>
<value>protocol-httpclient|urlfilter-regex|parse-(text|html|js)|index-(basic|anchor)|query-(basic|site|url)|response-(json|xml)|summary-basic|scoring-opic|urlnormalizer-(pass|regex|basic)</value>
</property>

iii)还在nutch-site.xml中定义了auth配置文件。

<property>
<name>http.auth.file</name>
<value>httpclient-auth.xml</value>
<description>Authentication configuration file for 'protocol-httpclient' plugin.
</description>

我无法抓取它并且没有错误..

要求:我想抓取像gmail.com或yahoomail.com这样的网站或任何要求进行身份验证的网站。

我哪里出错了,我选择了错误的网站进行抓取

(如果是,请向我提供要求认证的网站,我将为其注册)

(如果没有我如何抓取我的Gmail或Facebook帐户)

1 个答案:

答案 0 :(得分:3)

有助于您解决此问题的几点:

1)是的,您选择了错误的网站来抓取并索引尝试一些不同的网站。

2)Nutch仅支持 NTLM,基本或摘要式身份验证 。它不支持基于表单的身份验证。您尝试使用的网站具有基于表单的身份验证。

3)要实现基于表单的身份验证,您必须自定义Nutch代码。

我确信以下2个链接可以帮助您在这个问题上取得一些进展:

http://technical-fundas.blogspot.in/2014/05/nutch-solr-formed-based-authentication.html

http://technical-fundas.blogspot.in/2014/06/how-to-configure-nutch-in-eclipse-for.html