phantomfetch 0.4.2__tar.gz → 0.4.4__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.
- {phantomfetch-0.4.2 → phantomfetch-0.4.4}/PKG-INFO +2 -2
- {phantomfetch-0.4.2 → phantomfetch-0.4.4}/pyproject.toml +2 -2
- {phantomfetch-0.4.2 → phantomfetch-0.4.4}/src/phantomfetch/engines/browser/cdp.py +12 -10
- {phantomfetch-0.4.2 → phantomfetch-0.4.4}/README.md +0 -0
- {phantomfetch-0.4.2 → phantomfetch-0.4.4}/src/phantomfetch/__init__.py +0 -0
- {phantomfetch-0.4.2 → phantomfetch-0.4.4}/src/phantomfetch/cache.py +0 -0
- {phantomfetch-0.4.2 → phantomfetch-0.4.4}/src/phantomfetch/captcha.py +0 -0
- {phantomfetch-0.4.2 → phantomfetch-0.4.4}/src/phantomfetch/engines/__init__.py +0 -0
- {phantomfetch-0.4.2 → phantomfetch-0.4.4}/src/phantomfetch/engines/base.py +0 -0
- {phantomfetch-0.4.2 → phantomfetch-0.4.4}/src/phantomfetch/engines/browser/__init__.py +0 -0
- {phantomfetch-0.4.2 → phantomfetch-0.4.4}/src/phantomfetch/engines/browser/actions.py +0 -0
- {phantomfetch-0.4.2 → phantomfetch-0.4.4}/src/phantomfetch/engines/curl.py +0 -0
- {phantomfetch-0.4.2 → phantomfetch-0.4.4}/src/phantomfetch/fetch.py +0 -0
- {phantomfetch-0.4.2 → phantomfetch-0.4.4}/src/phantomfetch/pool.py +0 -0
- {phantomfetch-0.4.2 → phantomfetch-0.4.4}/src/phantomfetch/telemetry.py +0 -0
- {phantomfetch-0.4.2 → phantomfetch-0.4.4}/src/phantomfetch/tools/selector_builder.py +0 -0
- {phantomfetch-0.4.2 → phantomfetch-0.4.4}/src/phantomfetch/types.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: phantomfetch
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.4
|
|
4
4
|
Summary: High-performance agentic web scraping library combining curl-cffi speed with Playwright browser capabilities
|
|
5
5
|
Keywords: web-scraping,playwright,curl-cffi,async,browser-automation,http-client,agentic,anti-detection
|
|
6
6
|
Author: CosmicBull
|
|
@@ -17,7 +17,7 @@ Classifier: Framework :: AsyncIO
|
|
|
17
17
|
Requires-Dist: browserforge[all]>=0.5.0
|
|
18
18
|
Requires-Dist: curl-cffi>=0.13.0
|
|
19
19
|
Requires-Dist: msgspec>=0.20.0
|
|
20
|
-
Requires-Dist:
|
|
20
|
+
Requires-Dist: playwright>=1.50.0
|
|
21
21
|
Requires-Dist: undetected-playwright>=0.3.0
|
|
22
22
|
Requires-Dist: rusticsoup>=0.3.0
|
|
23
23
|
Requires-Dist: httpx>=0.27.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "phantomfetch"
|
|
3
|
-
version = "0.4.
|
|
3
|
+
version = "0.4.4"
|
|
4
4
|
description = "High-performance agentic web scraping library combining curl-cffi speed with Playwright browser capabilities"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.13"
|
|
@@ -32,7 +32,7 @@ dependencies = [
|
|
|
32
32
|
"browserforge[all]>=0.5.0",
|
|
33
33
|
"curl-cffi>=0.13.0",
|
|
34
34
|
"msgspec>=0.20.0",
|
|
35
|
-
"
|
|
35
|
+
"playwright>=1.50.0",
|
|
36
36
|
"undetected-playwright>=0.3.0",
|
|
37
37
|
"rusticsoup>=0.3.0",
|
|
38
38
|
"httpx>=0.27.0",
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import time
|
|
2
2
|
from typing import TYPE_CHECKING, Any, Optional
|
|
3
|
+
import sys
|
|
4
|
+
from urllib.parse import urlparse
|
|
3
5
|
|
|
4
6
|
from browserforge.fingerprints import FingerprintGenerator, Screen
|
|
5
7
|
from browserforge.injectors.playwright import AsyncNewContext
|
|
@@ -126,10 +128,7 @@ class CDPEngine:
|
|
|
126
128
|
async def connect(self) -> None:
|
|
127
129
|
"""Initialize Playwright and connect to browser."""
|
|
128
130
|
|
|
129
|
-
|
|
130
|
-
from rebrowser_playwright.async_api import async_playwright
|
|
131
|
-
else:
|
|
132
|
-
from playwright.async_api import async_playwright
|
|
131
|
+
from playwright.async_api import async_playwright
|
|
133
132
|
|
|
134
133
|
self._playwright = await async_playwright().start()
|
|
135
134
|
|
|
@@ -348,12 +347,15 @@ class CDPEngine:
|
|
|
348
347
|
context_opts["viewport"] = self.viewport
|
|
349
348
|
|
|
350
349
|
if proxy:
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
350
|
+
parsed = urlparse(proxy.url)
|
|
351
|
+
proxy_server = f"{parsed.scheme}://{parsed.hostname}:{parsed.port}" if parsed.port else f"{parsed.scheme}://{parsed.hostname}"
|
|
352
|
+
proxy_dict = {"server": proxy_server}
|
|
353
|
+
if parsed.username:
|
|
354
|
+
proxy_dict["username"] = parsed.username
|
|
355
|
+
if parsed.password:
|
|
356
|
+
proxy_dict["password"] = parsed.password
|
|
357
|
+
|
|
358
|
+
context_opts["proxy"] = proxy_dict
|
|
357
359
|
|
|
358
360
|
# If we have basic cookies to set via context creation (simpler than add_cookies sometimes)
|
|
359
361
|
# But better to use add_cookies for consistency with 'cookies' arg
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|