Created
October 28, 2016 19:19
-
-
Save schinken/edd132c186fe8a00e516c76c1d0f3219 to your computer and use it in GitHub Desktop.
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/python2 | |
import subprocess | |
import requests | |
import sys | |
import re | |
login_url = 'http://....' | |
login_user = 'foobar' | |
login_pass = '123123123' | |
other_url = 'http://......' | |
with requests.Session() as s: | |
print "Login into %s as %s ..." % (login_url, translator_user) | |
r1 = s.post(login_url, data={ | |
'username': login_user, | |
'password': login_pass, | |
'Login': 'Login' | |
}) | |
print "Doing stuff logged in" | |
r2 = s.get(other_url) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment