【发布时间】:2019-10-31 10:15:21
【问题描述】:
我想从 json url 获取 Value (BestPrice),如果它小于 250 - 做点什么! 网址=https://search.roblox.com/catalog/json?Category=2&SortType=2&ResultsPerPage=1
我已经尝试过 Aphid Il 发布我的代码
while True:
resp = requests.get(f"https://search.roblox.com/catalog/json?Category=2&SortType=2&ResultsPerPage=1")
data = json.loads(resp.text)
P = Aphid.findall(data, ['BestPrice'])
N = Aphid.findall(data, "Name")
S = Aphid.findall(data, "Sales")
print (f" {N} Tracking {P} R$ Sales - {S}")
if P < '250':
print("VALID")
我想获得 BestPrice 明确的数字,如果它小于 250 - 做某事
【问题讨论】:
标签: python json python-3.x web-scraping