title: Missing certain part of Cookies using requests.get()?
body: <p><strong>BackgroundInfo:</strong></p>
  
  <blockquote>
    <p>I am scraping amazon. I need to set up the session cookies before using requests.session.get() to get the final version of the page source code of a url.</p>
  </blockquote>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>import requests
  
  # I am currently working in China, so it's cn. 
  # Use the homepage to get cookies. Then use it later to scrape data.
  homepage = 'http://www.amazon.cn'
  headers = {'User-Agent':'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36'}
  response = requests.get(homepage,headers = headers)
  cookies = response.cookies
  
  #set up the Session object, so as to preserve the cookies between requests.
  session = requests.Session()
  session.headers = headers
  session.cookies = cookies
  
  #now begin download the source code
  url = 'https://www.amazon.cn/TCL-%E7%8E%8B%E7%89%8C-L65C2-CUDG-65%E8%8B%B1%E5%AF%B8-%E6%96%B0%E7%9A%84HDR%E6%8A%80%E6%9C%AF-%E5%85%A8%E6%96%B0%E7%9A%84%E9%87%8F%E5%AD%90%E7%82%B9%E6%8A%80%E6%9C%AF-%E9%BB%91%E8%89%B2/dp/B01FXB0ZG4/ref=sr_1_2?ie=UTF8&amp;qid=1476165637&amp;sr=8-2&amp;keywords=L65C2-CUDG'
  response = session.get(url)
  </code></pre>
  
  <p><strong>Desired Result:</strong></p>
  
  <p>When navigate to the amazon homepage in Chrome, the cookies should be something like:</p>
  
  <p><a href="https://i.stack.imgur.com/mZkLJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mZkLJ.png" alt="Amazon HomePage"></a></p>
  
  <p>As you can find in the cookies part,which I underscore in red, part of the cookies set by the response to our request to the homepage is "ubid-acbcn", which is also part of the request header, probably left from last visit.</p>
  
  <p>So that is the cookie I want, which I attempted to get by the above code.</p>
  
  <p>In python code, it should be a cookieJar, or a dictionary. Either way, its content should be something that contains <strong>'ubid-acbcn' and 'session-id'</strong>:</p>
  
  <pre><code>{'ubid-acbcn':'453-7613662-1073007','session-id':'455-1363863-7141553','otherparts':'otherparts'}
  </code></pre>
  
  <p><strong>What I am getting instead</strong>:
    The 'session-id' is there, but the 'ubid-acbcn' is missing.</p>
  
  <pre><code>&gt;&gt;homepage = 'http://www.amazon.cn'
  &gt;&gt;headers = {'User-Agent':'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36'}
  &gt;&gt;response = requests.get(homepage,headers = headers)
  &gt;&gt;cookies = response.cookies
  &gt;&gt;print(cookies.get_dict()):
  &gt;&gt;{'session-id': '456-2975694-3270026','otherparts':'otherparts'}
  </code></pre>
  
  <p><strong>Related Info:</strong></p>
  
  <ul>
  <li>OS: WINDOWS 10 </li>
  <li>PYTHON: 3.5</li>
  <li>requests: 2.11.1</li>
  </ul>
  
  <p>I am sorry for being a bit verbose. </p>
  
  <p>What I tried and figure:</p>
  
  <ol>
  <li>I googled for certain keywords, but nobody seems to be facing this
  problem. </li>
  <li>I figure it might be something to do with the amazon
      anti-scraping measure. But other than change my headers to disguise
      myself as a human, there isn't much I know I should do.</li>
  <li>I have also entertained the possibility that tt might not be a case of missing cookie. But rather I have not set up my requests.get(homepage,headers = headers) properly, hence the response.cookie is not as expected. Given this,I have tried to copying the request header in my browser, leaving out only the cookie part, but still the response cookie is missing the 'ubid-acbcn' part. Maybe some other parameter has to be set up? </li>
  </ol>