title: Login Amazon Music with Robobrowser
body: <p>I try to login to AmazonMusic using RoboBrowser.
  I got it working with Mechanize by using a script intended for Kodi, but since I want to user Python3 I also need it to work with RoboBrowser.</p>
  
  <p>This is working (Python 2):</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>br = mechanize.Browser()
  br.set_cookiejar(cj)
  br.set_handle_gzip(True)
  br.set_handle_robots(False)
  br.addheaders = [('User-Agent', userAgent)]
   br.open(urlMain + "/gp/dmusic/marketing/CloudPlayerLaunchPage/ref=dm_dp_mcn_cp")
  br.select_form(name="signIn")
  br["email"] = email
  br["password"] = password
  br.addheaders = [
                   ('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'),
                   ('Accept-Encoding', 'gzip, deflate'),
                   ('Accept-Language', 'de,en-US;q=0.8,en;q=0.6'),
                   ('Cache-Control', 'max-age=0'),
                   ('Connection', 'keep-alive'),
                   ('Content-Type', 'application/x-www-form-urlencoded'),
                   ('User-Agent', userAgent),
                   ('Upgrade-Insecure-Requests', '1')]
  br.submit()
  resp = br.response().read()</code></pre>
  </div>
  </div>
  </p>
  
  <p>This is my code for Python 3:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>import robobrowser
  from requests import Session
  
  session = Session()
  
  browser = robobrowser.RoboBrowser(session=session, history=True)
  browser.open("http://www.amazon.de/gp/dmusic/marketing/CloudPlayerLaunchPage/ref=dm_dp_mcn_cp")
  loginForm = browser.get_form(id='ap_signin_form')
  loginForm['email'] = "a"
  loginForm['password'] = "b"
  
  browser.submit_form(loginForm)
  #print(browser.parsed)</code></pre>
  </div>
  </div>
  </p>
  
  <p>The problem is that I get as answer, that I need to accept cookies.
  But how do I do that? I thought the cookies are stored in the session that i pass to the RoboBrowser and are reused for each POST. I also tried without passing a session in the beginning - doesn't make any difference...</p>
  
  <p>What am I doing wrong?
  I also tried with MechanicalSoup but got the same result.</p>