Skip to content

Instantly share code, notes, and snippets.

@schinken
Created October 28, 2016 19:19
Show Gist options
  • Save schinken/edd132c186fe8a00e516c76c1d0f3219 to your computer and use it in GitHub Desktop.
Save schinken/edd132c186fe8a00e516c76c1d0f3219 to your computer and use it in GitHub Desktop.
#!/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