📅  最后修改于: 2022-03-11 14:45:46.768000             🧑  作者: Mango
import requests
# By Link-Start
def get_coupons(store:str = 'displate') -> list:
url=f'https://d.joinhoney.com/v3?operationName=web_getStoreByLabel&variables=%7B%22label%22%3A%22{store}%22%7D'
data=requests.get(url).json()
coupons = []
for code in range(len(data['data']['getStoreByLabel']['publicCoupons'])):
coupons.append(data['data']['getStoreByLabel']['publicCoupons'][code]['code'])
return coupons
print(get_coupons(store='displate'))