与albertheijn.nl的隐藏rest api交互
albert的Python项目详细描述
Albert Heijn(非官方)rest接口
正在添加新功能
安装
pip install albert
用法
初始化api
import albert
ah = albert.Api("username","password")
在ah.nl帐户。
将产品添加到购物车
ah.add("wi386562",amount=30)
你可以在www.albertheijn.nl上找到产品。即https://www.ah.nl/producten2/product/wi383655/ah-conference-peren 默认情况下,如果不传递第二个参数,则会将一个项目添加到购物车。
购物车中的商品
ah.cart()
空车
ah.empty()
将购物车保存到列表
ah.shopping_list_add("Name of List", empty_card=False)
标准调用shopping_list_add方法后,默认情况下,购物车中的项目将保留。如果将第二个参数传递为true,则在将购物车项目保存到列表后,这些项目将从购物车中删除。
产品信息
ah_product = albert.Product('wi60539/ah-scharrelei-advocaat')
print(ah_product.id)
传递不带producten/product/的查询作为字符串参数以从产品检索信息。可以访问几个项目:
id
name
brand
description
summary
unit_size
category
is_available
priceLabel
price_current
price_previous
is_discounted