title: How can I get these Json code with Beautifulsoup?
body: <p>JSON
  </p>
  
  <pre><code> &lt;script&gt;
   var data2sales= 
   [{
     "key": "Owners",
     "bar": true,
     "values": [
       [1490400000000, 1591, "", "", ""],
       [1490486400000, 1924, "#2B6A94", "", ""],
       [1490572800000, 1982, "", "", ""],
       [1490659200000, 1606, "", "", ""]]
   }]
   &lt;/script&gt;
  </code></pre>
  
  <p>My code to get Json in Python
  </p>
  
  <pre><code> notices = str(soup.select('script')[30])
   split_words=notices.split('var data2sales= ')
   split_words=split_words[1]
   temp=split_words[44:689]
   temp = 'var data2sales= {' +temp + '}'
   print(temp)
   newDict = json.loads((temp))
   print(newDict)
  </code></pre>
  
  <p>I'm new to BeautifulSoup in Python and I'm trying to extract a <code>dict</code> from BeautifulSoup. As you can see in my code, I remake the JSON code with python and save in the newDict variable. But it doesn't work. Is there anyone can teach me, how can I extract that JSON code? Thank you.</p>