title: Parse/print out value from JSON content in Python
body: <p>I am trying to print out the price of an item from this page/JSON:
  <a href="https://shopee.sg/api/v2/item/get?itemid=2590867516&amp;shopid=165420215" rel="nofollow noreferrer">https://shopee.sg/api/v2/item/get?itemid=2590867516&amp;shopid=165420215</a>
  but I am encountering an error as below:</p>
  <p><code>print([d.get('price_max_before_discount') for d in site_json['item'] if d.get('price_max_before_discount')])</code></p>
  <blockquote>
  <p>AttributeError: 'str' object has no attribute 'get'</p>
  </blockquote>
  <pre><code>import json
  from urllib import request
  from bs4 import BeautifulSoup
  
  url = 'https://shopee.sg/api/v2/item/get?itemid=2590867516&amp;shopid=165420215'
  html = request.urlopen(url).read()
  soup = BeautifulSoup(html, 'html.parser')
  site_json = json.loads(soup.text)
  print([d.get('price_max_before_discount') for d in site_json['item'] if d.get('price_max_before_discount')])
  </code></pre>
  <p>not sure what I am doing wrong but I will appreciate any advice/solutions!</p>
  <p>Thank you.</p>