from typing import Union


def next_page(page: str) -> Union[None, str]:
    """ Given the contents of a Letterboxd page, returns
        the relative path to the next page to parse. It
        handles the pagination of any type of page,
        from followers, to following, to movies watched,
        etc.

        Returns None if this is the last page already
        and there isn't another one to parse.
    """
    key_page_next = "\"next\" href=\""

    start = page.rfind("paginate-nextprev")
    start = page.find(key_page_next, start)
    if start is -1:
        return None

    start += len(key_page_next)
    end_idx = page.find("\"", start)
    return page[start + 1:end_idx]