使用 Nutch 获取特定的 HTML 标签

发布于 2024-12-23 01:19:28 字数 755 浏览 2 评论 0原文

我会很详细地明确说明问题,所以请耐心等待:)

假设我有以下基本 URL: http://www.amazon.com/gp/goldbox/all-deals?ie=UTF8&type=bd
其中列出了一些产品并附有简洁的描述。每个列出的产品都有一个指向详细产品信息页面的 URL,例如: http://www.amazon.com/dp/B000WU7RGS/ref=xs_gb_all-deals_center_rw_uk_A34K0C99MV3O0U?pf_rd_p=1261804642 &pf_rd_s=center-2&pf_rd_t=701&pf_rd_i=30&pf_rd_m=ATVPDKIKX0DER&pf_rd_r=1FE5R5X5XYMG6GDPHPK5

现在我的要求是(例如)获取每个产品的名称、价格和产品信息。如何使用 Nutch 实现这一目标? Nutch 是必需的/好的选择,还是一个简单的 wget + 自己的 HTML 解析器是更好的方法?

注意:我必须对布局非常不同的多个页面执行此操作,并且唯一的输入是 URL 以及从 URL 获取的 html 标签

I will be little verbose to clearly specify the problem, so please be patient :)

Assume I have the following base URL: http://www.amazon.com/gp/goldbox/all-deals?ie=UTF8&type=bd
which lists a number of products with a concise description. Each listed product has a URL directing to a details product information page like: http://www.amazon.com/dp/B000WU7RGS/ref=xs_gb_all-deals_center_rw_uk_A34K0C99MV3O0U?pf_rd_p=1261804642&pf_rd_s=center-2&pf_rd_t=701&pf_rd_i=30&pf_rd_m=ATVPDKIKX0DER&pf_rd_r=1FE5R5X5XYMG6GDPHPK5

Now my requirements is to (for example) fetch name, price and product information for each of these products. How can I achieve this using Nutch? Is Nutch required/good option for this or just a plain simple wget + own HTML parser is a better way to go?

Note: I have to do this for multiple pages with very different layout and only input will be the URL and what html tags to fetch from the URL

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

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

发布评论

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

评论(1

一笑百媚生 2024-12-30 01:19:28

正在研究同样的问题。然而,似乎有一些累人的步骤来实现目标:

1-抓取 2-索引 3-通过 -readseg 获取原始 html 4-解析文件以获取您想要的信息

所以,Nutch 不似乎不是这样做的好方法。你找到答案了吗?

Working on the same problem. However, it seems like there are some tiring steps to achieve the goal:

1-crawl 2-index 3-get the raw html by -readseg 4-parse the file for information you want

So, Nutch doesn't seem to be the good way to do this. Have you managed to find out an answer?

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