def parse_apg_url(apg_url):
    """Return the method, url and browser from an apg_url."""
    method = apg_url.split("/apg/")[1].split("/?url=")[0]
    url = apg_url.split("/?url=")[1].split("&browser")[0]
    try:
        browser = apg_url.split("&browser=")[1].split("&")[0]
    except IndexError:
        browser = None
    return method, url, browser