如何获取亚马逊购物车的内容?
我一直在研究是否可以以编程方式获取我的亚马逊购物篮中已保存商品的列表。
他们的产品广告 API 具有获取愿望清单的方法,如下所述此处 并使用描述的远程购物车这里。
但是,存储在亚马逊网站上的商品的购物车被视为本地购物车,因此无法通过产品广告 API 访问。
根据最后一个链接:
与远程购物车相反的是本地购物车,即客户在 www.amazon.com 上购物时使用的购物车。它被认为是本地的,因为亚马逊托管购物网页和购物车。产品广告 API 操作仅适用于远程购物车。
除了抓取 HTML 之外,是否有人找到了获取“本地”购物车内容的方法?
I've been investigating whether it's possible to get a list of the saved items in my Amazon shopping basket programmatically.
Their Product Advertising API has methods for getting wishlists described here and working with remote shopping carts described here.
But the shopping cart of items stored while on the Amazon web site is treated as a local shopping cart, and therefore is not accessible through the Product Advertising API.
According to the last link:
The opposite of a remote shopping cart is a local shopping cart, which is the shopping cart customers use while shopping on www.amazon.com. It is considered local because Amazon hosts the shopping web pages as well as the shopping cart. Product Advertising API operations work solely with remote shopping carts.
Has anyone found a way of getting the contents of the "local" cart, apart from scraping the HTML?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我知道这是一个 10 年前的问题,但这里有一种使用 python3 来实现的方法。
您可以使用 BeautifulSoup 之类的工具来解析响应文本。为了使其正常工作,用户必须在 Chrome 中登录 Amazon。 browser_cookie3 也可以设置为使用其他浏览器。
I know this is a 10 year old question, but here is a way to do it using python3.
You can use something like BeautifulSoup to parse response text. In order for this to work the user must be signed into Amazon in Chrome. browser_cookie3 can be set to use other browsers as well.
亚马逊似乎没有在其 API 中提供此功能。但是,根据您的环境,可能可以在不使用 API 的情况下通过让用户登录并执行购物车页面的页面抓取来完成此操作。
此链接可能有用: http://bililite.com/blog/2010/10/31/hacking-my-way-to-an-amazon-wishlist-widget/
It appears that Amazon does not offer this in their API. However, depending on what your environment is it may be possible to do this without using the API by having the user sign in and doing a page scrape of the shopping cart page.
This link may be useful: http://bililite.com/blog/2010/10/31/hacking-my-way-to-an-amazon-wishlist-widget/