MCPcopy
hub / github.com/InstaPy/InstaPy / get_buttons_from_dialog

Function get_buttons_from_dialog

instapy/unfollow_util.py:1469–1486  ·  view source on GitHub ↗

Gets buttons from the `Followers` or `Following` dialog boxes

(dialog, channel)

Source from the content-addressed store, hash-verified

1467
1468
1469def get_buttons_from_dialog(dialog, channel):
1470 """Gets buttons from the `Followers` or `Following` dialog boxes"""
1471
1472 buttons = None
1473
1474 if channel == "Follow":
1475 # get follow buttons. This approach will find the follow buttons and
1476 # ignore the Unfollow/Requested buttons.
1477 buttons = dialog.find_elements(
1478 By.XPATH, read_xpath(get_buttons_from_dialog.__name__, "follow_button")
1479 )
1480
1481 elif channel == "Unfollow":
1482 buttons = dialog.find_elements(
1483 By.XPATH, read_xpath(get_buttons_from_dialog.__name__, "unfollow_button")
1484 )
1485
1486 return buttons
1487
1488
1489def get_user_id(browser, track, username, logger):

Callers

nothing calls this directly

Calls 1

read_xpathFunction · 0.85

Tested by

no test coverage detected