title: How to prevent redirection while parsing
body: <p>I'm parsing Instagram, and it started redirecting me to the login page.
  The scrip is just taking stuff from the main page with no logging functionality. <code>
  - window._sharedData</code></p>
  
  <p>How can I stop it from redirecting and still keep loading the targeted account main page?</p>
  
  <pre><code>for i in list_of_urls:
          headers = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36'}
          responce = requests.get(i,headers=headers)
          response_text = responce.text
          shared_data = response_text.split('window._sharedData = ')[1].split(';&lt;/script&gt;')[0]
  etc...
  </code></pre>
  
  <p>I've checked the redirections with:</p>
  
  <pre><code>for i in list_of_urls:
          headers = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36'}
          responce = requests.get(i,headers=headers)
          if responce.history:
             print("Request was redirected")
          for resp in responce.history:
              print(resp.status_code, resp.url)
          print("Final destination:")
          print(responce.status_code, responce.url)
      else:
          print("Request was not redirected")
  </code></pre>
  
  <p>And it does redirect:</p>
  
  <pre><code>https://www.instagram.com/_linails_/
  https://www.instagram.com/alena.nails.tallinn/
  Request was redirected
  302 https://www.instagram.com/_linails_/
  Final destination:
  200 https://www.instagram.com/accounts/login/
  Request was redirected
  302 https://www.instagram.com/alena.nails.tallinn/
  Final destination:
  200 https://www.instagram.com/accounts/login/
  Request was not redirected
  
  </code></pre>
  
  <p>Any idea how to make it stop redirecting or get back without logging?</p>
  
  <p>P.S.
  looks like Instagram got the idea that it is a script opening the pages.
  Here is the full response from it - <a href="https://yadi.sk/d/2vcng8VTBDz35A" rel="nofollow noreferrer">https://yadi.sk/d/2vcng8VTBDz35A</a></p>