I have a text file with usernames and passwords. The text file is formatted like this:
br.form['login'] = 'username1'
br.form['passwd'] = 'password1'
: characters in your usernames or passwords.
with open('myfile.txt') as f: credentials = [x.strip().split(':') for x in f.readlines()] for username,password in credentials: # your code here