Apache nutch:在解析之前操作 DOM

发布于 2024-12-22 14:45:21 字数 259 浏览 4 评论 0原文

我想在页面响应被处理之前删除特定元素。 具体来说,我想用 ie 标记我的页面的一部分

 <div class="noindex">I shall not be indexed</div>

,并想在 nuch 解析之前删除它们,这样之后的 NutchDocument 中就不会出现“我不会被索引”的情况。我计划用它来包围我的导航、页眉、页脚内容,因为现在它们存在于索引中的每个文档中。

谢谢, 保罗

I want to remove specific elements from the page response, before it is handed down to nutch.
Specifically, I want to mark parts of my pages with i.e.

 <div class="noindex">I shall not be indexed</div>

And want to remove them before nutch parse, so that "I shall not be indexed" is not present in the NutchDocument afterwards. I plan die surround my navigation, header, footer content with this because right now, they are present in every document in the index.

Thanks,
Paul

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

友谊不毕业 2024-12-29 14:45:21

你有一些替代方案可以做到这一点:

You have some alternativer for doing that:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文