title: Grabbing Cookie from Server with Python Requests
body: <p>I have been looking at the Requests documentation for a way to grab a site cookie for use elsewhere in my code. The documentation states the following:</p>
  
  <pre><code>If a response contains some Cookies, you can quickly access them:
  
  &gt;&gt;&gt; url = 'http://example.com/some/cookie/setting/url'
  &gt;&gt;&gt; r = requests.get(url)
  
  &gt;&gt;&gt; r.cookies['example_cookie_name']
  'example_cookie_value'
  </code></pre>
  
  <p>I'm not sure however what would go inside the square brackets after <code>r.cookies</code>. If I try submitting with no square brackets at all I get the following output:</p>
  
  <pre><code>&lt;&lt;class 'requests.cookies.RequestsCookieJar'&gt;[]&gt;
  </code></pre>
  
  <p>Can anyone tell me what I need to do with the above to get the actual cookies returned back to me, please?</p>
  
  <p>Thanks</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>In response to the first comment below, here is some example code, which is returning an empty dictionary for the cookie. Can anyone tell me why?</p>
  
  <pre><code>import requests, requests.utils
  
  r = requests.get('http://www.whoscored.com/tournamentsfeed/12496/Fixtures/?d=2015W32&amp;isAggregate=false')
  session = requests.session()
  rr = requests.utils.dict_from_cookiejar(session.cookies)
  print rr
  </code></pre>