fix(Fetchers/page_action): Fixing logic

This commit is contained in:
Karim shoair
2024-12-16 12:34:23 +02:00
parent 3ecffcb81c
commit eceef48ef5
2 changed files with 12 additions and 6 deletions
+6 -3
View File
@@ -64,11 +64,14 @@ class CamoufoxEngine:
self.addons = addons or []
self.humanize = humanize
self.timeout = check_type_validity(timeout, [int, float], 30000)
if callable(page_action):
self.page_action = page_action
if page_action is not None:
if callable(page_action):
self.page_action = page_action
else:
self.page_action = None
log.error('[Ignored] Argument "page_action" must be callable')
else:
self.page_action = None
log.error('[Ignored] Argument "page_action" must be callable')
self.wait_selector = wait_selector
self.wait_selector_state = wait_selector_state
+6 -3
View File
@@ -75,11 +75,14 @@ class PlaywrightEngine:
self.cdp_url = cdp_url
self.useragent = useragent
self.timeout = check_type_validity(timeout, [int, float], 30000)
if page_action is not None and callable(page_action):
self.page_action = page_action
if page_action is not None:
if callable(page_action):
self.page_action = page_action
else:
self.page_action = None
log.error('[Ignored] Argument "page_action" must be callable')
else:
self.page_action = None
log.error('[Ignored] Argument "page_action" must be callable')
self.wait_selector = wait_selector
self.wait_selector_state = wait_selector_state