|
|
|
@ -49,6 +49,10 @@ browser_step_ui_config = {'Choose one': '0 0',
|
|
|
|
|
# ONLY Works in Playwright because we need the fullscreen screenshot
|
|
|
|
|
class steppable_browser_interface():
|
|
|
|
|
page = None
|
|
|
|
|
start_url = None
|
|
|
|
|
|
|
|
|
|
def __init__(self, start_url):
|
|
|
|
|
self.start_url = start_url
|
|
|
|
|
|
|
|
|
|
# Convert and perform "Click Button" for example
|
|
|
|
|
def call_action(self, action_name, selector=None, optional_value=None):
|
|
|
|
@ -87,6 +91,10 @@ class steppable_browser_interface():
|
|
|
|
|
logger.debug(f"Time to goto URL {time.time()-now:.2f}s")
|
|
|
|
|
return response
|
|
|
|
|
|
|
|
|
|
# Incase they request to go back to the start
|
|
|
|
|
def action_goto_site(self, selector=None, value=None):
|
|
|
|
|
return self.action_goto_url(value=self.start_url)
|
|
|
|
|
|
|
|
|
|
def action_click_element_containing_text(self, selector=None, value=''):
|
|
|
|
|
if not len(value.strip()):
|
|
|
|
|
return
|
|
|
|
@ -194,10 +202,11 @@ class browsersteps_live_ui(steppable_browser_interface):
|
|
|
|
|
|
|
|
|
|
browser_type = os.getenv("PLAYWRIGHT_BROWSER_TYPE", 'chromium').strip('"')
|
|
|
|
|
|
|
|
|
|
def __init__(self, playwright_browser, proxy=None, headers=None):
|
|
|
|
|
def __init__(self, playwright_browser, proxy=None, headers=None, start_url=None):
|
|
|
|
|
self.headers = headers or {}
|
|
|
|
|
self.age_start = time.time()
|
|
|
|
|
self.playwright_browser = playwright_browser
|
|
|
|
|
self.start_url = start_url
|
|
|
|
|
if self.context is None:
|
|
|
|
|
self.connect(proxy=proxy)
|
|
|
|
|
|
|
|
|
|