i'm trying to access the Amazon Seller Central through python and Mechanize.
This is my code, i think it's working, but when i check a page that is only accessible of you login, it get redirected to a page that says: "to continue using Amazon, please activate cookies in you browser, once the cookies enabled, please click on the button below to go back to the previous page"
How can i enable cookies in my python or mechanize setup?
import mechanize
import urllib2
import cookielib
import requests
browser = mechanize.Browser()
browser.set_handle_robots(False) # ignore robots
browser.set_handle_refresh(False) # can sometimes hang without this
cj = cookielib.CookieJar()
browser.set_cookiejar(cj)
USERNAME = 'MyUsername'
PASSWORD = 'MyPass'
response = browser.open("https://sellercentral.amazon.fr/gp/homepage.html")
browser.select_form("signinWidget")
browser.form['username'] = USERNAME
browser.form['password'] = PASSWORD
responsecheck = browser.submit()
print responsecheck.read()
check = browser.open("https://sellercentral.amazon.fr/gp/global-selling/gateway-widget-crosslisting-potential/crosslisting-potential-widget-internals.html?_=1411311676093")
print check.read()
Thank you in advance,
Thomas