import requests
import re


def get_random_wiki_topic(category):
    """Return page-string for a random page in a category."""
    print(category)
    resp = requests.get(
        f"https://en.wikipedia.org/wiki/Special:RandomInCategory/{category}",
        allow_redirects=False,
    )
    page_string = resp.headers["Location"].split("/wiki/")[-1]
    page_string = re.sub("Category:", "", page_string)
    return page_string