title: Get JSON from website (instagram)
body: <p>I recently got the idea to scrape information from instagram accounts and their posts, like the amount of comments or amount of likes. I got so far that I figured out while debugging in chrome that for example the link <strong><a href="https://www.instagram.com/instagram/?__a" rel="noreferrer">https://www.instagram.com/instagram/?__a</a></strong> under the network tab returns a JSON with the wanted information, but what is actually loaded is still the normal website html code.</p>
  
  <p><a href="https://i.stack.imgur.com/dvXQ9.png" rel="noreferrer"><img src="https://i.stack.imgur.com/dvXQ9.png" alt="json data"></a></p>
  
  <p>so far I tried in python with this code: </p>
  
  <pre><code>import urllib.request
  r = urllib.request.urlopen(url)
  print(r.read())
  </code></pre>
  
  <p>or in javascript :</p>
  
  <pre><code>window.onload = function () {
      res = fetch("https://www.instagram.com/instagram/?__a", {
          method: 'get'
      }).then(function (data) {
          return data.json();
      }).catch(function (error) {
          console.log("ERROR".concat(error.toString()));
      });
      console.log(res.user);
  };
  </code></pre>
  
  <p>So the problem I have, is that when using these functions I only get the website code (<strong>html</strong>), is there a way to only get the JSON which is loaded in the background? I know people will recommend me using the instagram api, but I have no website nor a company to register.</p>