MCPcopy
hub / github.com/InstaPy/InstaPy / click_visibly

Function click_visibly

instapy/util.py:2039–2058  ·  view source on GitHub ↗

Click as the element become visible

(browser, element)

Source from the content-addressed store, hash-verified

2037
2038
2039def click_visibly(browser, element):
2040 """Click as the element become visible"""
2041 if element.is_displayed():
2042 click_element(browser, element)
2043
2044 else:
2045 browser.execute_script(
2046 "arguments[0].style.visibility = 'visible'; "
2047 "arguments[0].style.height = '10px'; "
2048 "arguments[0].style.width = '10px'; "
2049 "arguments[0].style.opacity = 1",
2050 element,
2051 )
2052 # update server calls
2053 update_activity(browser, state=None)
2054 sleep(randint(1, 5))
2055
2056 click_element(browser, element)
2057
2058 return True
2059
2060
2061def get_action_delay(action):

Callers 2

follow_userFunction · 0.85
verify_actionFunction · 0.85

Calls 4

click_elementFunction · 0.85
update_activityFunction · 0.85
sleepFunction · 0.85
execute_scriptMethod · 0.80

Tested by

no test coverage detected