Skip to content

Instantly share code, notes, and snippets.

@mandarl
Last active June 7, 2017 13:51
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mandarl/6007396 to your computer and use it in GitHub Desktop.
Save mandarl/6007396 to your computer and use it in GitHub Desktop.
Simple mechanize script to login to Dyn
import re
import mechanize
username = "username"
password = "password"
success_verification_text = "Log Out"
br = mechanize.Browser()
response = br.open("https://account.dyn.com/")
#select the login form
for form1 in br.forms():
form = form1
break;
br.select_form(nr=0)
form["username"] = username
form["password"] = password
response = br.submit()
if success_verification_text in response.read():
print "SUCCESS"
else:
print "FAILED"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment