fix: handle errors during image dimension updates in AsyncPlaywrightCrawlerStrategy
This commit is contained in:
@@ -920,7 +920,11 @@ class AsyncPlaywrightCrawlerStrategy(AsyncCrawlerStrategy):
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
try:
|
||||||
|
await page.wait_for_load_state()
|
||||||
await page.evaluate(update_image_dimensions_js)
|
await page.evaluate(update_image_dimensions_js)
|
||||||
|
except Exception as e:
|
||||||
|
raise RuntimeError(f"Error updating image dimensions ACS-UPDATE_IMAGE_DIMENSIONS_JS: {str(e)}")
|
||||||
|
|
||||||
# Wait a bit for any onload events to complete
|
# Wait a bit for any onload events to complete
|
||||||
await page.wait_for_timeout(100)
|
await page.wait_for_timeout(100)
|
||||||
|
|||||||
Reference in New Issue
Block a user