Answers for "list of famous people"

0

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")
Posted by: Guest on June-03-2021

Browse Popular Code Answers by Language