I'm trying to prompt the user for the username and password to login to a site. My plan is to use requests to send the POST data. Here is the code I have so far:
import requests
import getpass
uname = raw_input("Username: ")
passw = getpass.getpass(prompt = "Password: ")
FORM_DATA = {
"__EVENTTARGET:",
"__EVENTARGUMENT:",
"__VIEWSTATE:/wEPDwUKMTA5NTA5ODU1MQ9kFgJmD2QWAgIGDxBkDxYFZgIBAgICAwIEF***REMAINDER REMOVED***",
"__EVENTVALIDATION:/wEdAAp4d3BHvSTs+Kv6cxGP3xEbBr8xrgRYad2tj4YCyRIw5qUAjimf****REMAINDER REMOVED****",
"jsCheck:",
"ddlEngine: REMOVED:13008",
"Username: %(uname)s" ,
"Password: %(passw)s",
"btnLogin.x: 42",
"btnLogin.y: 9",
"btnLogin: Login",
}
print FORM_DATA
This is obviously just a portion of the POST data, but I want to verify the credentials are passed first before moving forward. Using print does not show that the input has been inserted into the defined spots.