list of famous people code example

Example: list of famous people

import requests

S = requests.Session()

URL = "https://en.wikipedia.org/w/api.php"

SEARCHPAGE = "Sarasadasdasdsdah"

PARAMS = {
    "action": "query",
    "format": "json",
    "list": "search",
    "srsearch": SEARCHPAGE
}

R = S.get(url=URL, params=PARAMS)
DATA = R.json()

try: 
  if DATA['query']['search'][0]['title'] == SEARCHPAGE:
      print("Your search page '" + SEARCHPAGE + "' exists on English Wikipedia")
except:
  print("Your search page '" + SEARCHPAGE + "' does not exist on English Wikipedia")