diff --git a/defaultconf.json b/defaultconf.json index 6ad1205..ac51298 100644 --- a/defaultconf.json +++ b/defaultconf.json @@ -1,4 +1,5 @@ { "datadir": "data/", + "browserdriver": "phantomjs", "credfile": "cred.txt" } diff --git a/leggi.py b/leggi.py index 79f158d..be1c336 100644 --- a/leggi.py +++ b/leggi.py @@ -15,8 +15,8 @@ def read_pass_file(fname): return user, pwd -def get_calls(user, password): - with Browser('phantomjs') as b: +def get_calls(user, password, driver='firefox'): + with Browser(driver) as b: b.visit('https://www.messagenet.com/') b.fill('userid', user) b.fill('password', password) @@ -43,5 +43,5 @@ if __name__ == '__main__': if len(sys.argv) == 2: conf.update(json.load(open(sys.argv[1]))) user, password = read_pass_file(conf['credfile']) - calls = tuple(get_calls(user, password)) + calls = tuple(get_calls(user, password, conf['browserdriver'])) save_calls(calls, conf['datadir'])