fix : blocks not appearing on front for planner agent

This commit is contained in:
martin legrand
2025-04-24 12:22:52 +02:00
parent 812af254b5
commit 82aecd0aae
5 changed files with 42 additions and 19 deletions
+11 -7
View File
@@ -166,13 +166,17 @@ class Browser:
try:
initial_handles = self.driver.window_handles
self.driver.get(url)
wait = WebDriverWait(self.driver, timeout=10)
wait.until(
lambda driver: (
not any(keyword in driver.page_source.lower() for keyword in ["checking your browser", "captcha"])
),
message="stuck on 'checking browser' or verification screen"
)
try:
wait = WebDriverWait(self.driver, timeout=10)
wait.until(
lambda driver: (
not any(keyword in driver.page_source.lower() for keyword in ["checking your browser", "captcha"])
),
message="stuck on 'checking browser' or verification screen"
)
except TimeoutException:
self.logger.warning("Timeout while waiting for page to bypass 'checking your browser'")
return False
self.apply_web_safety()
self.logger.log(f"Navigated to: {url}")
return True