Compare commits
1 Commits
feature/sc
...
0.4.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aadbcb3481 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -215,3 +215,6 @@ todo_executor.md
|
|||||||
protect-all-except-feature.sh
|
protect-all-except-feature.sh
|
||||||
manage-collab.sh
|
manage-collab.sh
|
||||||
publish.sh
|
publish.sh
|
||||||
|
|
||||||
|
combine.sh
|
||||||
|
combined_output.txt
|
||||||
@@ -7,6 +7,7 @@ import os, sys, shutil
|
|||||||
import tempfile, subprocess
|
import tempfile, subprocess
|
||||||
from playwright.async_api import async_playwright, Page, Browser, Error
|
from playwright.async_api import async_playwright, Page, Browser, Error
|
||||||
from playwright.async_api import TimeoutError as PlaywrightTimeoutError
|
from playwright.async_api import TimeoutError as PlaywrightTimeoutError
|
||||||
|
from playwright.async_api import TimeoutError as PlaywrightTimeoutError
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
from PIL import Image, ImageDraw, ImageFont
|
from PIL import Image, ImageDraw, ImageFont
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
@@ -931,7 +932,11 @@ class AsyncPlaywrightCrawlerStrategy(AsyncCrawlerStrategy):
|
|||||||
# Wait for network idle after initial load and images to load
|
# Wait for network idle after initial load and images to load
|
||||||
await page.wait_for_load_state("networkidle")
|
await page.wait_for_load_state("networkidle")
|
||||||
await asyncio.sleep(0.1)
|
await asyncio.sleep(0.1)
|
||||||
await page.wait_for_function("Array.from(document.images).every(img => img.complete)")
|
try:
|
||||||
|
await page.wait_for_function("Array.from(document.images).every(img => img.complete)", timeout=1000)
|
||||||
|
# Check for TimeoutError and ignore it
|
||||||
|
except PlaywrightTimeoutError:
|
||||||
|
pass
|
||||||
|
|
||||||
# After initial load, adjust viewport to content size
|
# After initial load, adjust viewport to content size
|
||||||
if not self.text_only and kwargs.get("adjust_viewport_to_content", False):
|
if not self.text_only and kwargs.get("adjust_viewport_to_content", False):
|
||||||
|
|||||||
Reference in New Issue
Block a user