PlaywrightCapture 1.40.7__tar.gz → 1.40.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PlaywrightCapture
3
- Version: 1.40.7
3
+ Version: 1.40.8
4
4
  Summary: A simple library to capture websites using playwright
5
5
  License-Expression: BSD-3-Clause
6
6
  License-File: LICENSE
@@ -292,7 +292,7 @@ class Capture():
292
292
 
293
293
  return self
294
294
 
295
- async def __aexit__(self, exc_type: Any, exc: Any, tb: Any) -> bool:
295
+ async def __aexit__(self, exc_type: Any, exc_value: Any, traceback: Any) -> bool:
296
296
  """Close browser resources and suppress exceptions like the upstream context manager."""
297
297
 
298
298
  if self.browser.is_connected():
@@ -315,6 +315,9 @@ class Capture():
315
315
  except Exception as e:
316
316
  self.logger.warning(f'Unable to remove temp HAR file {self._temp_harfile.name}: {e}')
317
317
 
318
+ if exc_type:
319
+ self.logger.warning(f'An exception occured during the capture: {exc_value}')
320
+ return False
318
321
  return True
319
322
 
320
323
  async def setup_page_capture(self, *, allow_tracking: bool=False) -> Page:
@@ -2275,6 +2278,10 @@ class Capture():
2275
2278
  try:
2276
2279
  self.logger.debug(f'Attempting to fetch favicon from {u}.')
2277
2280
  url_to_fetch = urljoin(rendered_url, u)
2281
+ if url_to_fetch.startswith('/'):
2282
+ self.logger.info(f'Landing page not valid, cannot get favicon: {rendered_url}')
2283
+ continue
2284
+
2278
2285
  if self.only_global_lookup:
2279
2286
  not_local, message = self.__check_local_url(url_to_fetch)
2280
2287
  if not_local is False:
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "PlaywrightCapture"
3
- version = "1.40.7"
3
+ version = "1.40.8"
4
4
  description = "A simple library to capture websites using playwright"
5
5
  authors = [
6
6
  {name="Raphaël Vinot", email= "raphael.vinot@circl.lu"}