File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -121,11 +121,13 @@ async def screenshot_urls(self, urls):
121121 async def screenshot (self , url ):
122122 try :
123123 tab = await self .new_tab (url )
124- return await tab .screenshot ()
124+ await tab .screenshot ()
125+ return tab .webscreenshot
125126 except asyncio .TimeoutError :
126127 self .log .info (f"URL { url } load timed out after { self .timeout } seconds" )
128+ raise
127129 except Exception as e :
128- self .log .error (f"Error taking screenshot for { url } : { e } " )
130+ self .log .error (f"Error visiting { url } : { e } " )
129131 raise
130132 finally :
131133 with suppress (Exception ):
@@ -134,7 +136,8 @@ async def screenshot(self, url):
134136 async def new_tab (self , url ):
135137 tab = Tab (self )
136138 await tab .create ()
137- return await asyncio .wait_for (tab .navigate (url ), timeout = self .timeout )
139+ await asyncio .wait_for (tab .navigate (url ), timeout = self .timeout )
140+ return tab
138141
139142 async def start (self ):
140143 await self .detect_chrome_path ()
You can’t perform that action at this time.
0 commit comments