新加坡食物需求图书馆
pySGDabao的Python项目详细描述
Pysgdabao
为您的新加坡食品配送需求提供图书馆
当前支持
- 食品标准
- 交付
- 诚实的蜜蜂
开始
frompySGDabaoimport*postal_code=530511foodpanda_client=Foodpanda(postal_code)print(foodpanda_client.get_menu_items("KFC (Hougang Mall)"))"""[ { "description": "1 HotBlaze Grilled Chicken, 3 pcs Nuggets, 1 side and 1 drink", "image": "", "name": "HotBlaze Grilled Meal", "price": 10.95 }, { "description": "1 HotBlaze Grilled Chicken, 3 pcs Chicken, 3 pcs Hot & Crispy Tenders, 2 sides and 2 drinks", "image": "", "name": "HotBlaze Grilled Buddy Meal", "price": 26.95 }, ...]"""
主要功能
pySGDabao.Foodpanda(self, postal_code, base_url="https://sg.fd-api.com/")
pySGDabao.Deliveroo(self, postal_code, base_url="https://deliveroo.com.sg/")
pySGDabao.Honestbee(self, postal_code, base_url="https://www.honestbee.sg/")
Creates an object that stores information regarding the available restaurants located near the given postal code. If
base_url
is specified, all HTTP requests to be made will be relative to it.
pySGDabao.Foodpanda.get_restaurant_names()
pySGDabao.Deliveroo.get_restaurant_names()
pySGDabao.Honestbee.get_restaurant_names()
Gets a list of restaurant names near the given postal code
pySGDabao.Foodpanda.get_url(restaurant_name)
pySGDabao.Deliveroo.get_url(restaurant_name)
pySGDabao.Honestbee.get_url(restaurant_name)
Gets the URL link to the given restaurant's page
pySGDabao.Foodpanda.get_menu_items(restaurant_name)
pySGDabao.Deliveroo.get_menu_items(restaurant_name)
pySGDabao.Honestbee.get_menu_items(restaurant_name)
Gets a list of dictionaries comprising the name, description, price and image URL of each item sold by the given restaurant
高级功能
pySGDabao.Foodpanda.scrape_restaurants()
pySGDabao.Deliveroo.scrape_restaurants()
pySGDabao.Honestbee.scrape_restaurants()
Returns the raw JSON from the website's search page
pySGDabao.Foodpanda.scrape_menu(restaurant_name)
pySGDabao.Deliveroo.scrape_menu(restaurant_name)
pySGDabao.Honestbee.scrape_menu(restaurant_name)
Returns the raw JSON from the given restaurant's page