har2tree 1.31.1__py3-none-any.whl → 1.31.3__py3-none-any.whl

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.
har2tree/helper.py CHANGED
@@ -286,7 +286,7 @@ def make_soup(html: bytes) -> BeautifulSoup:
286
286
  try:
287
287
  return BeautifulSoup(doc_as_str, 'lxml')
288
288
  except Exception as e:
289
- logger.warning(f'Unable to parse doc with lxml, try again with the default parser: {e}')
289
+ logger.info(f'Unable to parse doc with lxml, try again with the default parser: {e}')
290
290
  # Fallback to the default python parser
291
291
  return BeautifulSoup(doc_as_str, 'html.parser')
292
292
 
@@ -385,8 +385,13 @@ def find_external_ressources(mimetype: str, data: bytes, base_url: str, all_requ
385
385
  else:
386
386
  external_ressources['css'].append(url)
387
387
  else:
388
- soup = make_soup(data)
389
- string_soup = str(soup)
388
+ try:
389
+ soup = make_soup(data)
390
+ string_soup = str(soup)
391
+ except Exception as e:
392
+ logger.warning(f'Unable to parse HTML blob: {e}')
393
+ string_soup = ''
394
+
390
395
  if not string_soup:
391
396
  # Empty HTML document, nothing to do
392
397
  return external_ressources, embedded_ressources
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: har2tree
3
- Version: 1.31.1
3
+ Version: 1.31.3
4
4
  Summary: HTTP Archive (HAR) to ETE Toolkit generator
5
5
  License: BSD-3-Clause
6
6
  Author: Raphaël Vinot
@@ -28,7 +28,7 @@ Requires-Dist: legacy-cgi (>=2.6.3) ; python_version >= "3.13,<4.0"
28
28
  Requires-Dist: numpy (<2.1) ; python_version < "3.10"
29
29
  Requires-Dist: numpy (<2.3) ; python_version < "3.11"
30
30
  Requires-Dist: numpy (>=2.3.1) ; python_version >= "3.11"
31
- Requires-Dist: publicsuffixlist (>=1.0.2.20250627)
31
+ Requires-Dist: publicsuffixlist (>=1.0.2.20250719)
32
32
  Requires-Dist: six (>=1.17.0) ; extra == "docs"
33
33
  Requires-Dist: tinycss2 (>=1.4.0)
34
34
  Requires-Dist: w3lib (>=2.3.1)
@@ -1,10 +1,10 @@
1
1
  har2tree/__init__.py,sha256=Na3mxHkUBq3rzYbxiLNJF37DxH5mcghSorjzXw5Teug,422
2
2
  har2tree/har2tree.py,sha256=47x9X5tY69f9SXkYJgJsnAaX2kxgXHgzFThGz6M86Zw,44495
3
- har2tree/helper.py,sha256=mwCNI4YHyuVGFT11GgeYclsk6m5kKNr2Q6YWY-VNs3U,20540
3
+ har2tree/helper.py,sha256=CgeXqfBeHs8SbkW7TRNKqJBTZLAu63KggQjbGHCZAGI,20681
4
4
  har2tree/nodes.py,sha256=CC3NseEaM455JOpPqjfTAQ-dwWiGWmzlceGSSeTwoRo,28951
5
5
  har2tree/parser.py,sha256=4yej1OcVYAIiLfzYZsO9WCw3WyM_ykDTuvpW7UO1ROE,3645
6
6
  har2tree/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
- har2tree-1.31.1.dist-info/LICENSE,sha256=Xa4EVROgJsEo10CW-ISCRiw0TtqdKz1JuM3BBLBM55c,1803
8
- har2tree-1.31.1.dist-info/METADATA,sha256=uH1yroPazJiA1ISX9v8nr7WWFk7_a_qn8EkknivK4j0,2112
9
- har2tree-1.31.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
10
- har2tree-1.31.1.dist-info/RECORD,,
7
+ har2tree-1.31.3.dist-info/LICENSE,sha256=Xa4EVROgJsEo10CW-ISCRiw0TtqdKz1JuM3BBLBM55c,1803
8
+ har2tree-1.31.3.dist-info/METADATA,sha256=PSDu0bnPUYje8It-uyZfcDVbo4TTTC7RCzH-2CRAc0U,2112
9
+ har2tree-1.31.3.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
10
+ har2tree-1.31.3.dist-info/RECORD,,