I am trying to use Mechanize to login to a page and download a file but it doesn't seem to work as expected. This is after I have failed with urllib2 and requests.
import mechanize
username = '***'
password = '***'
url = 'https://emea1.login.cp.thomsonreuters.net/auth/UI/Login'
br = mechanize.Browser()
br.set_handle_robots(False)
request = br.open(url)
br.select_form(name="frmSignIn")
br['IDToken1'] = username # Set the form values
br['IDToken2'] = password # Set the form values
resp = br.submit()
print resp.read()
The output is same as the source code of url, same was the case with requests and urllib
PS: I tried using selenium only to find my corporate server won't have firefox etc. installed.