def unlike_page(driver, url, archive=None):
    """
    Unlikes a page given the URL to it
    Args:
        driver: seleniumrequests.Chrome Driver instance
        url: url string pointing to a page
        archive: archiver instance

    Returns:
        None

    """

    driver.get(url)

    print("Unliking {0}".format(url))

    wait = WebDriverWait(driver, 5)

    try:
        wait.until(
            EC.presence_of_element_located((By.XPATH, "//*[text()='Liked']"))
        )
    except SELENIUM_EXCEPTIONS:
        # Something went wrong with this page, so skip it
        return

    driver.find_element_by_xpath("//*[text()='Liked']/../../../..").click()

    wait.until(
        EC.presence_of_element_located((By.XPATH, "//*[text()='Unlike']"))
    )

    # There should be an "Unlike" button now, click it
    driver.find_element_by_xpath("//*[text()='Unlike']/..").click()

    if archive:
        archive(Page(name=url))

    Unlikes a page given the URL to it
    Args:
        driver: seleniumrequests.Chrome Driver instance
        url: url string pointing to a page
        archive: archiver instance

    Returns:
        None

    
deletefb/tools/likes.py