title: Use existing authenticated session from browser to perform https request on python
body: <p>Is it possible to take an existing logged in session (say in Chrome) and pipe that session to a python script to perform an https request?</p>
  
  <p>To  be clear on what I want to do, there's a website whose content can only  be accessed if you're logged in, however curling the credentials for simple http auth is not viable since it actually has captcha. So what I'm trying to do is, log in on say a browser, and extract that session to a python script, and request the url through that session. Am I making sense?</p>
  
  <pre><code>import requests
  
  url="http://stackoverflow.com/"
  headers = {"User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36"}
  cookie = {
      "domain": ".stackoverflow.com",
      "expirationDate": "1427212131.77312",
      "hostOnly": "false",
      "httpOnly": "true",
      "name": "usr",
      "path": "/",
      "secure": "false",
      "session": "false",
      "storeId": "0",
      "value": "SOMEVALUE",
      "id": "5"
  }
  
  t = open("response.txt", "w")
  
  
  t.write(requests.get(url, headers=headers, cookies=cookie).text.encode("ascii", "ignore"))
  </code></pre>
  
  <p>So I tried this out, and it doesn't seem to be getting me anywhere. If I look at the response, I see that it's actually the page without any user logged into it. Not sure what else am I missing...</p>