File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
dataframe_image/converter/browser Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,11 @@ def screenshot(self, html):
8282 )
8383 pass
8484 page .wait_for_timeout (200 )
85- screenshot_bytes = locator .screenshot (timeout = 1000 )
85+ try :
86+ screenshot_bytes = locator .screenshot (timeout = 1000 )
87+ except Error :
88+ logger .warning ("Locator screenshot timed out. Taking full page screenshot instead." )
89+ screenshot_bytes = page .screenshot (timeout = 1000 )
8690 im = Image .open (BytesIO (screenshot_bytes ))
8791 return im
8892
@@ -168,6 +172,10 @@ async def screenshot(self, html):
168172 )
169173 pass
170174 page .wait_for_timeout (200 )
171- screenshot_bytes = await locator .screenshot (timeout = 1000 )
175+ try :
176+ screenshot_bytes = await locator .screenshot (timeout = 1000 )
177+ except Error :
178+ logger .warning ("Locator screenshot timed out. Taking full page screenshot instead." )
179+ screenshot_bytes = await page .screenshot (timeout = 1000 )
172180 im = Image .open (BytesIO (screenshot_bytes ))
173181 return im
You can’t perform that action at this time.
0 commit comments