Created
November 4, 2016 20:30
-
-
Save clay584/ec19a54815a1e3d98da490f1457ce7ce to your computer and use it in GitHub Desktop.
Cisco.com login using mechanize
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import mechanize | |
def main(): | |
br = mechanize.Browser() | |
br.addheaders = [('User-agent', 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.6')] | |
br.open("http://www.cisco.com/c/login/index.html?referer=/c/en/us/index.html") | |
br.select_form(name="login-form") | |
br.form['userid'] = '[email protected]' | |
br.form['password'] = r'Sup3rS3cretPass' | |
response = br.submit() | |
html = response.read() | |
print html | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment