Я продолжаю царапать себе голову, почему он не печатает содержимое json, в котором я нуждаюсь. Кто-нибудь знает, что я делаю неправильно?Python print json данные из запросов
Это словарь
> "listinginfo": {
> "438309609514180554": {
> "listingid": "438309609514180554",
> "price": 35,
> "fee": 4,
> "publisher_fee_app": 730,
> "publisher_fee_percent": "0.10000000149011612",
> "currencyid": "2003",
> "steam_fee": 1,
> "publisher_fee": 3,
> "converted_price": 50,
> "converted_fee": 7,
> "converted_currencyid": "2020",
> "converted_steam_fee": 2,
> "converted_publisher_fee": 5,
> "converted_price_per_unit": 50,
> "converted_fee_per_unit": 7,
> "converted_steam_fee_per_unit": 2,
> "converted_publisher_fee_per_unit": 5,
> "asset": {
> "currency": 0,
> "appid": 730,
> "contextid": "2",
> "id": "1579403640",
> "amount": "1",
> "market_actions": [
> {
код + мне нужны значения для ключей, которые я хочу, чтобы напечатать:
while 1:
r = requests.get(url, headers=headers)
listingInfoStr = r.content
result= ujson.loads(listingInfoStr)
listingInfoJson= result['listinginfo']
for listingdata in listingInfoJson:
print listingdata.get('listingId')
print listingdata.get('subTotal')
print listingdata.get('feeAmount')
print listingdata.get('totalPrice')
time.sleep(10)
Благодарим Вас за Ваше время.
Причина listingInfoJson не повторяется? это просто диктатор – pmod