Advertisement
Didicodes

Untitled

Sep 28th, 2018
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. import requests
  2.  
  3. S = requests.Session()
  4.  
  5. URL = "https://mediawiki.org/w/api.php"
  6.  
  7. PARAMS_1 = {
  8.     'action': 'query',
  9.     'meta': 'tokens',
  10.     'format': 'json'
  11. }
  12. R = S.get(url=URL, params=PARAMS_1)
  13. DATA = R.json()
  14.  
  15. CREATE_CSRF_TOKEN = DATA['query']['tokens']['csrftoken']
  16. print(CREATE_CSRF_TOKEN)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement