Advertisement
Guest User

Untitled

a guest
Aug 25th, 2016
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. login_token = '/api.php?action=query&format=xml&prop=&list=&meta=tokens&type=login'
  2. r = requests.get (wiki + login_token)
  3. logintoken = re.compile (r'(?<=logintoken=["])[^"]+(?=["])')
  4. logintoken = logintoken.search (r.text).group()
  5.  
  6. user="---"
  7. password="---"
  8. login = '/api.php?action=login&format=xml&lgname=' + user + '&lgpassword=' + password + '&lgtoken=' + logintoken
  9. r = requests.post (wiki + login)
  10. print (r.text)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement