🕷️ The BEST Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev
Python aiai-scrapingautomationcrawlercrawlingcrawling-pythondatadata-extractionmcpmcp-serverplaywrightpythonscrapingselectorsstealthweb-scraperweb-scrapingweb-scraping-pythonwebscrapingxpath
fix(Fetchers/page_action): Fixing logic
Karim shoaireceef48ef5f7
diff --git a/scrapling/engines/camo.py b/scrapling/engines/camo.pyindex 5d22aa5..1eb9976 100644--- a/scrapling/engines/camo.py+++ b/scrapling/engines/camo.py@@ -64,11 +64,14 @@ class CamoufoxEngine:self.addons = addons or []self.humanize = humanizeself.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_selectorself.wait_selector_state = wait_selector_statediff --git a/scrapling/engines/pw.py b/scrapling/engines/pw.pyindex 16d7a8a..e4c80b7 100644--- a/scrapling/engines/pw.py+++ b/scrapling/engines/pw.py@@ -75,11 +75,14 @@ class PlaywrightEngine:self.cdp_url = cdp_urlself.useragent = useragentself.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_selectorself.wait_selector_state = wait_selector_state