import requests


def extract_wiki_text(wikipedia_title, language='en'):
    """Get the text of the given wikipedia article."""
    base_url = ('https://' + language + '.wikipedia.org/w/api.php?action=query'
                + '&prop=extracts&format=json&explaintext='
                + '&exsectionformat=plain&titles=')
    text = ''

    r = requests.get(base_url + wikipedia_title)
    if r.status_code == 200:
        pages = r.json()['query']['pages']
        for (id, page) in pages.items():
            text += page['extract']

    return text