PlaywrightCapture 1.31.7__tar.gz → 1.32.0__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.
- {playwrightcapture-1.31.7 → playwrightcapture-1.32.0}/PKG-INFO +3 -3
- {playwrightcapture-1.31.7 → playwrightcapture-1.32.0}/playwrightcapture/capture.py +10 -4
- {playwrightcapture-1.31.7 → playwrightcapture-1.32.0}/pyproject.toml +6 -6
- {playwrightcapture-1.31.7 → playwrightcapture-1.32.0}/LICENSE +0 -0
- {playwrightcapture-1.31.7 → playwrightcapture-1.32.0}/README.md +0 -0
- {playwrightcapture-1.31.7 → playwrightcapture-1.32.0}/playwrightcapture/__init__.py +0 -0
- {playwrightcapture-1.31.7 → playwrightcapture-1.32.0}/playwrightcapture/exceptions.py +0 -0
- {playwrightcapture-1.31.7 → playwrightcapture-1.32.0}/playwrightcapture/helpers.py +0 -0
- {playwrightcapture-1.31.7 → playwrightcapture-1.32.0}/playwrightcapture/py.typed +0 -0
- {playwrightcapture-1.31.7 → playwrightcapture-1.32.0}/playwrightcapture/socks5dnslookup.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: PlaywrightCapture
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.32.0
|
4
4
|
Summary: A simple library to capture websites using playwright
|
5
5
|
License: BSD-3-Clause
|
6
6
|
Author: Raphaël Vinot
|
@@ -20,9 +20,9 @@ Classifier: Topic :: Security
|
|
20
20
|
Provides-Extra: recaptcha
|
21
21
|
Requires-Dist: SpeechRecognition (>=3.14.3) ; extra == "recaptcha"
|
22
22
|
Requires-Dist: aiohttp-socks (>=0.10.1)
|
23
|
-
Requires-Dist: aiohttp[speedups] (>=3.12.
|
23
|
+
Requires-Dist: aiohttp[speedups] (>=3.12.15)
|
24
24
|
Requires-Dist: async-timeout (>=5.0.1) ; python_version < "3.11"
|
25
|
-
Requires-Dist: beautifulsoup4[charset-normalizer,lxml] (>=4.13.
|
25
|
+
Requires-Dist: beautifulsoup4[charset-normalizer,lxml] (>=4.13.5)
|
26
26
|
Requires-Dist: dateparser (>=1.2.2)
|
27
27
|
Requires-Dist: dnspython (>=2.7.0,<3.0.0)
|
28
28
|
Requires-Dist: playwright (>=1.54.0)
|
@@ -234,8 +234,6 @@ class Capture():
|
|
234
234
|
|
235
235
|
async def __aenter__(self) -> Capture:
|
236
236
|
'''Launch the browser'''
|
237
|
-
self._temp_harfile = NamedTemporaryFile(delete=False)
|
238
|
-
|
239
237
|
self.playwright = await async_playwright().start()
|
240
238
|
|
241
239
|
if self.device_name:
|
@@ -255,11 +253,12 @@ class Capture():
|
|
255
253
|
# Set of URLs that were captured in that context
|
256
254
|
self._already_captured: set[str] = set()
|
257
255
|
|
256
|
+
# Create the temporary file to store the HAR content.
|
257
|
+
self._temp_harfile = NamedTemporaryFile(delete=False, prefix="playwright_capture_har", suffix=".json")
|
258
|
+
|
258
259
|
return self
|
259
260
|
|
260
261
|
async def __aexit__(self, exc_type: Any, exc: Any, tb: Any) -> bool:
|
261
|
-
if hasattr(self, '_temp_harfile'):
|
262
|
-
os.unlink(self._temp_harfile.name)
|
263
262
|
|
264
263
|
try:
|
265
264
|
await self.browser.close(reason="Closing browser at the end of the capture.")
|
@@ -271,6 +270,13 @@ class Capture():
|
|
271
270
|
except Exception as e:
|
272
271
|
# this should't happen, but just in case it does...
|
273
272
|
self.logger.info(f'Unable to stop playwright: {e}')
|
273
|
+
|
274
|
+
if hasattr(self, '_temp_harfile'):
|
275
|
+
try:
|
276
|
+
os.unlink(self._temp_harfile.name)
|
277
|
+
except Exception as e:
|
278
|
+
self.logger.warning(f'Unable to remove temp HAR file {self._temp_harfile.name}: {e}')
|
279
|
+
|
274
280
|
return True
|
275
281
|
|
276
282
|
@property
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[project]
|
2
2
|
name = "PlaywrightCapture"
|
3
|
-
version = "1.
|
3
|
+
version = "1.32.0"
|
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"}
|
@@ -14,14 +14,14 @@ dynamic = [ "classifiers" ]
|
|
14
14
|
dependencies = [
|
15
15
|
"playwright (>=1.54.0)",
|
16
16
|
"dateparser (>=1.2.2)",
|
17
|
-
"beautifulsoup4[charset-normalizer,lxml] (>=4.13.
|
17
|
+
"beautifulsoup4[charset-normalizer,lxml] (>=4.13.5)",
|
18
18
|
"w3lib (>=2.3.1)",
|
19
19
|
"tzdata (>=2025.2)",
|
20
20
|
"playwright-stealth (>=2)",
|
21
21
|
"setuptools (>=80.9.0)",
|
22
22
|
"puremagic (>=1.30)",
|
23
23
|
"async-timeout (>=5.0.1) ; python_version < \"3.11\"",
|
24
|
-
"aiohttp[speedups] (>=3.12.
|
24
|
+
"aiohttp[speedups] (>=3.12.15)",
|
25
25
|
"aiohttp-socks (>=0.10.1)",
|
26
26
|
"typing-extensions (>=4.12.2,<5.0.0) ; python_version < \"3.12\"",
|
27
27
|
"dnspython (>=2.7.0,<3.0.0)",
|
@@ -51,9 +51,9 @@ recaptcha = [
|
|
51
51
|
[tool.poetry.group.dev.dependencies]
|
52
52
|
types-beautifulsoup4 = "^4.12.0.20250516"
|
53
53
|
pytest = "^8.4.1"
|
54
|
-
mypy = "^1.17.
|
55
|
-
types-dateparser = "^1.2.2.
|
56
|
-
types-pytz = "^2025.2.0.
|
54
|
+
mypy = "^1.17.1"
|
55
|
+
types-dateparser = "^1.2.2.20250809"
|
56
|
+
types-pytz = "^2025.2.0.20250809"
|
57
57
|
|
58
58
|
|
59
59
|
[build-system]
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|