Merge pull request #1529 from unclecode/fix/remove_overlay_elements

Fix remove_overlay_elements functionality by calling injected JS function.
This commit is contained in:
Nasrin
2025-11-06 00:10:32 +08:00
committed by GitHub
2 changed files with 17 additions and 2 deletions

View File

@@ -1383,9 +1383,10 @@ class AsyncPlaywrightCrawlerStrategy(AsyncCrawlerStrategy):
try:
await self.adapter.evaluate(page,
f"""
(() => {{
(async () => {{
try {{
{remove_overlays_js}
const removeOverlays = {remove_overlays_js};
await removeOverlays();
return {{ success: true }};
}} catch (error) {{
return {{