产品比价脚本

发布于 2024-07-27 21:36:05 字数 433 浏览 1 评论 0原文

您将如何构建价格比较脚本? 我知道亚马逊提供公共 API,但我看到了这两个网站 goodreadsbookdope< /a> 比较图书价格,从沃尔玛和其他不提供 API 的网站检索价格。 如何从没有 API 的网站获取价格?

我正在使用 C# 和 ASP.NET MVC。

How would you build a price comparison script? I know Amazon offers a public API, but I saw these two sites goodreads, bookdope which compare book prices, retrieve prices from Walmart and others websites that do not offer APIs. How do you get prices from sites that do not have an API?

I'm using C# and ASP.NET MVC.

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

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

发布评论

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

评论(1

迟月 2024-08-03 21:36:05

如果该网站不提供 API,那么您需要执行所谓的屏幕抓取。 您获取页面的 HTML,然后让程序从中提取信息。

这可行,但要注意问题。

公司通常不喜欢你这样做。 如果他们希望您获取信息,他们会提供 API。 他们甚至可能检测到来自您特定位置的大量点击并阻止您。

最重要的是,该页面是为人们在浏览器中阅读而设计的。 他们可以随时更改它,您的申请可能会因此失败。

If the site does not offer an API then you need to do what is called screen scraping. You get the HTML of the page and you have your program extract the information out of it.

This works, but beware of the problems.

Companies ofen don't like you doing this. If they wanted you to get the information they'd have provided an API. They may even detect a high number of hits from your specific location and block you.

Above all else, the page is designed for a human to read in a browser. They can change it at any time and your application may fail as a result.

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