title: How to download HTML source of an Instagram page
body: <p>in my app i need to download HTML source of an Instagram profile and parse it to get some information (media and followed-by count).
  That's my code (it works for all sites i tested, except for Instagram):</p>
  
  <pre><code>try {
              InputStream in;
              URL url = new URL(urlString);
  
              URLConnection conn = url.openConnection();
              if(!(conn instanceof HttpURLConnection))
                  throw new NoConnectionException("not instanceof http");
  
              HttpURLConnection httpConn = (HttpURLConnection) conn;
              httpConn.setAllowUserInteraction(false);
              httpConn.setInstanceFollowRedirects(true);
              httpConn.setRequestMethod("GET");
  
              in = httpConn.getInputStream();
  
              BufferedReader br = new BufferedReader(new InputStreamReader(in));
              String line;
              String source = "";
              while((line = br.readLine()) != null)
                  source += line;
              br.close();
  } catch(Exception e) {}
  </code></pre>
  
  <p>When i debug it with LogCat, String source is empty.</p>