MCPcopy
hub / github.com/InstaPy/InstaPy / dismiss_notification_offer

Function dismiss_notification_offer

instapy/login_util.py:566–580  ·  view source on GitHub ↗

Dismiss 'Turn on Notifications' offer on session start

(browser, logger)

Source from the content-addressed store, hash-verified

564
565
566def dismiss_notification_offer(browser, logger):
567 """Dismiss 'Turn on Notifications' offer on session start"""
568 offer_elem_loc = read_xpath(dismiss_notification_offer.__name__, "offer_elem_loc")
569 dismiss_elem_loc = read_xpath(
570 dismiss_notification_offer.__name__, "dismiss_elem_loc"
571 )
572
573 # wait a bit and see if the 'Turn on Notifications' offer rises up
574 offer_loaded = explicit_wait(
575 browser, "VOEL", [offer_elem_loc, "XPath"], logger, 4, False
576 )
577
578 if offer_loaded:
579 dismiss_elem = browser.find_element(By.XPATH, dismiss_elem_loc)
580 click_element(browser, dismiss_elem)
581
582
583def dismiss_save_information(browser, logger):

Callers 2

bypass_suspicious_loginFunction · 0.85
login_userFunction · 0.85

Calls 3

read_xpathFunction · 0.85
explicit_waitFunction · 0.85
click_elementFunction · 0.85

Tested by

no test coverage detected