gpt4 book ai didi

java - Nutch 1.6 查找重定向的原始 url

转载 作者:行者123 更新时间:2023-12-01 12:17:59 25 4
gpt4 key购买 nike

我想知道在重定向后如何找到原始网址。它们实际上是在种子列表中找到的,但我不能保证哪个网址被重定向到哪个网址。在 Fetcher 阶段,我希望从 Nutch.WRITABLE_REPR_URL_KEY 读取它,但它被重定向的 url 覆盖。

有什么建议如何从crawldb、segment或linkdb中读取它们吗?

PS:我只抓取种子列表上的一级页面(深度:1)。

最好,图格塞姆。

最佳答案

您可以通过执行以下操作转储外链

bin/nutch readseg -dump crawl/segments/segmentname/ outputdir -nocontent -nofetch -    nogenerate -noparse -noparsetext

此外,为了正确遵循重定向,您可能需要在 nutch-default.xml 中更改此属性

<property>
<name>http.redirect.max</name>
<value>5</value>
<description>The maximum number of redirects the fetcher will follow when
trying to fetch a page. If set to negative or 0, fetcher won't immediately
follow redirected URLs, instead it will record them for later fetching.
</description>
</property>

关于java - Nutch 1.6 查找重定向的原始 url,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26865985/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com