def get_buttons_from_dialog(dialog, channel):
    """ Gets buttons from the `Followers` or `Following` dialog boxes"""
    if channel == 'Follow':
        buttons = dialog.find_elements_by_xpath("//button[text()='Follow']")
    elif channel == 'Unfollow':
        buttons = dialog.find_elements_by_xpath(
            "//button[text() = 'Following']")
    return buttons
