Hi all,
I am new here and currently I am trying to generate login token for my local url http://localhost/mediawiki/index.php/Main_Page but i am getting response 404
here is my code
import requests
S = requests.Session()
URL = "http://localhost/mediawiki/index.php/Main_Page"
# Retrieve login token first
PARAMS_0 = {
'action':"query",
'meta':"tokens",
'type':"login",
'format':"json"
}
R = S.get(url=URL, params=PARAMS_0)
print(R)
DATA = R.json()
LOGIN_TOKEN = DATA['query']['tokens']['logintoken']
print('data',DATA)