parsek-cdp 0.1.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.
- parsek_cdp-0.1.0/LICENSE +201 -0
- parsek_cdp-0.1.0/PKG-INFO +277 -0
- parsek_cdp-0.1.0/README.md +262 -0
- parsek_cdp-0.1.0/parsek_cdp/__init__.py +55 -0
- parsek_cdp-0.1.0/parsek_cdp/_logging.py +49 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/__init__.py +247 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/accessibility/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/accessibility/events.py +35 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/accessibility/functions.py +202 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/accessibility/types.py +235 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/animation/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/animation/events.py +52 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/animation/functions.py +140 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/animation/types.py +113 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/audits/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/audits/events.py +21 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/audits/functions.py +95 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/audits/types.py +1051 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/autofill/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/autofill/events.py +27 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/autofill/functions.py +64 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/autofill/types.py +108 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/backgroundservice/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/backgroundservice/events.py +40 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/backgroundservice/functions.py +59 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/backgroundservice/types.py +63 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/bluetoothemulation/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/bluetoothemulation/events.py +70 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/bluetoothemulation/functions.py +247 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/bluetoothemulation/types.py +120 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/browser/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/browser/events.py +46 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/browser/functions.py +350 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/browser/types.py +158 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/cachestorage/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/cachestorage/events.py +13 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/cachestorage/functions.py +126 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/cachestorage/types.py +89 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/cast/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/cast/events.py +38 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/cast/functions.py +77 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/cast/types.py +23 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/console/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/console/events.py +22 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/console/functions.py +36 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/console/types.py +30 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/css/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/css/events.py +79 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/css/functions.py +788 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/css/types.py +742 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/debugger/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/debugger/events.py +164 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/debugger/functions.py +663 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/debugger/types.py +171 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/deviceaccess/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/deviceaccess/events.py +30 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/deviceaccess/functions.py +54 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/deviceaccess/types.py +28 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/deviceorientation/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/deviceorientation/events.py +13 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/deviceorientation/functions.py +35 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/deviceorientation/types.py +10 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/dom/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/dom/events.py +228 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/dom/functions.py +1033 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/dom/types.py +293 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/domdebugger/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/domdebugger/events.py +13 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/domdebugger/functions.py +155 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/domdebugger/types.py +57 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/domsnapshot/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/domsnapshot/events.py +13 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/domsnapshot/functions.py +111 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/domsnapshot/types.py +312 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/domstorage/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/domstorage/events.py +60 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/domstorage/functions.py +79 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/domstorage/types.py +30 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/emulation/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/emulation/events.py +17 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/emulation/functions.py +688 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/emulation/types.py +305 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/eventbreakpoints/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/eventbreakpoints/events.py +13 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/eventbreakpoints/functions.py +41 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/eventbreakpoints/types.py +10 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/extensions/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/extensions/events.py +13 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/extensions/functions.py +118 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/extensions/types.py +19 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/fedcm/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/fedcm/events.py +45 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/fedcm/functions.py +93 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/fedcm/types.py +72 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/fetch/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/fetch/events.py +82 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/fetch/functions.py +215 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/fetch/types.py +81 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/filesystem/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/filesystem/events.py +13 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/filesystem/functions.py +36 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/filesystem/types.py +54 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/headlessexperimental/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/headlessexperimental/events.py +13 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/headlessexperimental/functions.py +77 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/headlessexperimental/types.py +24 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/heapprofiler/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/heapprofiler/events.py +65 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/heapprofiler/functions.py +193 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/heapprofiler/types.py +57 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/indexeddb/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/indexeddb/events.py +13 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/indexeddb/functions.py +232 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/indexeddb/types.py +120 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/input/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/input/events.py +25 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/input/functions.py +361 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/input/types.py +87 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/inspector/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/inspector/events.py +41 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/inspector/functions.py +27 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/inspector/types.py +10 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/io/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/io/events.py +13 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/io/functions.py +77 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/io/types.py +13 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/layertree/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/layertree/events.py +36 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/layertree/functions.py +178 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/layertree/types.py +104 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/log/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/log/events.py +22 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/log/functions.py +54 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/log/types.py +57 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/media/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/media/events.py +87 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/media/functions.py +27 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/media/types.py +101 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/memory/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/memory/events.py +13 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/memory/functions.py +164 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/memory/types.py +71 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/mixins/__init__.py +21 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/mixins/datatype.py +123 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/mixins/event.py +78 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/mixins/namespace.py +31 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/network/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/network/events.py +726 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/network/functions.py +734 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/network/types.py +1247 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/overlay/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/overlay/events.py +54 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/overlay/functions.py +407 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/overlay/types.py +328 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/page/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/page/events.py +416 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/page/functions.py +1081 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/page/types.py +1088 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/performance/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/performance/events.py +24 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/performance/functions.py +63 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/performance/types.py +22 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/performancetimeline/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/performancetimeline/events.py +22 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/performancetimeline/functions.py +30 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/performancetimeline/types.py +85 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/preload/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/preload/events.py +116 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/preload/functions.py +25 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/preload/types.py +267 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/profiler/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/profiler/events.py +64 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/profiler/functions.py +134 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/profiler/types.py +105 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/pwa/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/pwa/events.py +13 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/pwa/functions.py +196 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/pwa/types.py +45 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/runtime/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/runtime/events.py +123 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/runtime/functions.py +552 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/runtime/types.py +319 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/schema/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/schema/events.py +13 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/schema/functions.py +32 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/schema/types.py +22 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/security/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/security/events.py +64 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/security/functions.py +66 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/security/types.py +168 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/serviceworker/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/serviceworker/events.py +43 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/serviceworker/functions.py +115 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/serviceworker/types.py +95 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/storage/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/storage/events.py +288 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/storage/functions.py +571 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/storage/types.py +656 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/systeminfo/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/systeminfo/events.py +13 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/systeminfo/functions.py +75 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/systeminfo/types.py +132 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/target/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/target/events.py +109 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/target/functions.py +424 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/target/types.py +83 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/tethering/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/tethering/events.py +22 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/tethering/functions.py +35 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/tethering/types.py +10 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/tracing/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/tracing/events.py +61 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/tracing/functions.py +119 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/tracing/types.py +81 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/webaudio/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/webaudio/events.py +184 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/webaudio/functions.py +51 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/webaudio/types.py +155 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/webauthn/__init__.py +15 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/webauthn/events.py +69 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/webauthn/functions.py +214 -0
- parsek_cdp-0.1.0/parsek_cdp/cdp/webauthn/types.py +96 -0
- parsek_cdp-0.1.0/parsek_cdp/core/__init__.py +18 -0
- parsek_cdp-0.1.0/parsek_cdp/core/browser.py +240 -0
- parsek_cdp-0.1.0/parsek_cdp/core/browser_context.py +58 -0
- parsek_cdp-0.1.0/parsek_cdp/core/element.py +405 -0
- parsek_cdp-0.1.0/parsek_cdp/core/feature.py +376 -0
- parsek_cdp-0.1.0/parsek_cdp/core/frame.py +351 -0
- parsek_cdp-0.1.0/parsek_cdp/core/pagable.py +175 -0
- parsek_cdp-0.1.0/parsek_cdp/core/page.py +163 -0
- parsek_cdp-0.1.0/parsek_cdp/core/target.py +490 -0
- parsek_cdp-0.1.0/parsek_cdp/features/__init__.py +14 -0
- parsek_cdp-0.1.0/parsek_cdp/features/request_listener/__init__.py +256 -0
- parsek_cdp-0.1.0/parsek_cdp/features/request_listener/events.py +48 -0
- parsek_cdp-0.1.0/parsek_cdp/features/request_listener/types.py +235 -0
- parsek_cdp-0.1.0/parsek_cdp/generate.py +642 -0
- parsek_cdp-0.1.0/parsek_cdp/parsek/__init__.py +18 -0
- parsek_cdp-0.1.0/parsek_cdp/parsek/events.py +38 -0
- parsek_cdp-0.1.0/parsek_cdp/parsek/types.py +36 -0
- parsek_cdp-0.1.0/parsek_cdp/py.typed +0 -0
- parsek_cdp-0.1.0/parsek_cdp.egg-info/PKG-INFO +277 -0
- parsek_cdp-0.1.0/parsek_cdp.egg-info/SOURCES.txt +245 -0
- parsek_cdp-0.1.0/parsek_cdp.egg-info/dependency_links.txt +1 -0
- parsek_cdp-0.1.0/parsek_cdp.egg-info/requires.txt +4 -0
- parsek_cdp-0.1.0/parsek_cdp.egg-info/top_level.txt +1 -0
- parsek_cdp-0.1.0/pyproject.toml +29 -0
- parsek_cdp-0.1.0/setup.cfg +4 -0
parsek_cdp-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: parsek-cdp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Chrome DevTools Protocol client — generated protocol layer + async runtime (client scope).
|
|
5
|
+
Author: xa1era
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Repository, https://github.com/xa1era/parsek-cdp
|
|
8
|
+
Requires-Python: >=3.13
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Requires-Dist: websockets>=12
|
|
12
|
+
Provides-Extra: server
|
|
13
|
+
Requires-Dist: parsek-cdp-server~=0.1.0; extra == "server"
|
|
14
|
+
Dynamic: license-file
|
|
15
|
+
|
|
16
|
+
# parsek-cdp
|
|
17
|
+
|
|
18
|
+
An async [Chrome DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/)
|
|
19
|
+
client for driving Chromium-based browsers from Python.
|
|
20
|
+
|
|
21
|
+
The protocol layer (`cdp/`) is **fully generated** from the official
|
|
22
|
+
[devtools-protocol](https://github.com/ChromeDevTools/devtools-protocol) JSON
|
|
23
|
+
definitions — one typed module per domain. The runtime (`core/`) is
|
|
24
|
+
hand-written: one websocket per target, typed command calls, event handlers and
|
|
25
|
+
an opt-in feature system. No `sessionId` multiplexing — every target (browser,
|
|
26
|
+
page, worker, OOPIF) gets its own connection.
|
|
27
|
+
|
|
28
|
+
Requires **Python 3.12+** (the API uses PEP 695 generics) and a running
|
|
29
|
+
Chromium/Chrome with remote debugging enabled.
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pip install parsek-cdp
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
> Документация на русском: [README.ru.md](README.ru.md).
|
|
36
|
+
|
|
37
|
+
## Quickstart
|
|
38
|
+
|
|
39
|
+
Start a browser with remote debugging:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
chromium --headless=new --remote-debugging-port=9222
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Then drive it:
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
import asyncio
|
|
49
|
+
from parsek_cdp import Browser, Page, RequestListener
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
async def main():
|
|
53
|
+
# `page_class` types every page in this browser as Page[RequestListener].
|
|
54
|
+
browser = await Browser.connect_http(
|
|
55
|
+
"http://127.0.0.1:9222", page_class=Page[RequestListener]
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
page = await browser.new_page()
|
|
59
|
+
requests = page.get_feature(RequestListener)
|
|
60
|
+
|
|
61
|
+
await page.navigate("https://example.com", wait_load=True)
|
|
62
|
+
|
|
63
|
+
for r in requests.requests:
|
|
64
|
+
status = r.response.status_code if r.response else "(pending)"
|
|
65
|
+
print(r.method, r.url, "->", status)
|
|
66
|
+
|
|
67
|
+
await browser.close()
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
asyncio.run(main())
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Concepts
|
|
74
|
+
|
|
75
|
+
### Targets and connections
|
|
76
|
+
|
|
77
|
+
A `Target` *is* a single CDP session on its own websocket. `Browser`, `Page`,
|
|
78
|
+
workers and out-of-process iframes are all targets. The DevTools host is bound
|
|
79
|
+
once (in a `contextvar`) when the browser is reached, so it is not threaded
|
|
80
|
+
through every call.
|
|
81
|
+
|
|
82
|
+
The full command surface is reached through `target.cdp`, one attribute per CDP
|
|
83
|
+
domain, with typed methods and results:
|
|
84
|
+
|
|
85
|
+
```python
|
|
86
|
+
await page.cdp.Network.enable()
|
|
87
|
+
info = await page.cdp.Target.get_target_info()
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Domains enable/disable themselves on use, and `domain_enabled` scopes a domain
|
|
91
|
+
to a block:
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
async with page.domain_enabled(page.cdp.Page):
|
|
95
|
+
await page.cdp.Page.navigate(url="https://example.com")
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Events
|
|
99
|
+
|
|
100
|
+
Register handlers on a specific target, or globally on the event class:
|
|
101
|
+
|
|
102
|
+
```python
|
|
103
|
+
from parsek_cdp.cdp import Network
|
|
104
|
+
|
|
105
|
+
# per-target
|
|
106
|
+
page.on(Network.RequestWillBeSent, lambda e: print(e.request.url))
|
|
107
|
+
|
|
108
|
+
# globally, for every target
|
|
109
|
+
@Network.RequestWillBeSent.add_handler
|
|
110
|
+
async def on_request(e):
|
|
111
|
+
print(e.request.url)
|
|
112
|
+
|
|
113
|
+
# await a single event
|
|
114
|
+
loaded = await page.wait_for(Network.ResponseReceived, timeout=10)
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Handlers may be sync or async; one failing handler never tears down the
|
|
118
|
+
connection or stops the others.
|
|
119
|
+
|
|
120
|
+
### Pages, frames and elements
|
|
121
|
+
|
|
122
|
+
A `Page` *is its own main frame*, so frame methods work on the top frame
|
|
123
|
+
directly:
|
|
124
|
+
|
|
125
|
+
```python
|
|
126
|
+
el = await page.select(selector="h1") # query the main frame
|
|
127
|
+
print(el.text)
|
|
128
|
+
await el.fill("hello")
|
|
129
|
+
await el.mouse_click()
|
|
130
|
+
|
|
131
|
+
title = await page.evaluate("document.title")
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
The full frame tree (subframes, cross-origin OOPIFs — each transparently routed
|
|
135
|
+
through its own session) lives on `page.frames`. `page.with_same_navigation()`
|
|
136
|
+
guards a block against a main-frame navigation cutting it short.
|
|
137
|
+
|
|
138
|
+
### Browser contexts
|
|
139
|
+
|
|
140
|
+
Pages are grouped into browser contexts (incognito-like profiles). The default
|
|
141
|
+
context holds pages created without an explicit one:
|
|
142
|
+
|
|
143
|
+
```python
|
|
144
|
+
context = await browser.create_context() # isolated profile
|
|
145
|
+
page = await context.new_page("https://example.com")
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Features
|
|
149
|
+
|
|
150
|
+
A `Page` attaches **no** behaviour by default. A *feature* is a unit of
|
|
151
|
+
behaviour you opt into, either declaratively or imperatively:
|
|
152
|
+
|
|
153
|
+
```python
|
|
154
|
+
from parsek_cdp import Page, RequestListener
|
|
155
|
+
|
|
156
|
+
Page[RequestListener] # declarative — typed page class
|
|
157
|
+
page.get_feature(RequestListener) # imperative — attached on first use, typed
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
The key idea: a feature is written **once** and runs in three roles —
|
|
161
|
+
|
|
162
|
+
- **local** — direct to the browser: the producers subscribe to raw CDP on the
|
|
163
|
+
page and reduce it in-process (a plain local `Page`);
|
|
164
|
+
- **server** — the proxy feeds raw CDP to the producers, whose output is emitted
|
|
165
|
+
to the client as a `Parsek.*` event *and* reduced locally for snapshots;
|
|
166
|
+
- **client** — only the reducers run, fed by those `Parsek.*` events off the wire.
|
|
167
|
+
|
|
168
|
+
Conceptually that is two *sides* — a *producer* of `Parsek.*` events and a *view*
|
|
169
|
+
of them — but the producer side exists both in-process (`local`) and over the
|
|
170
|
+
wire (`server`). The reducers run in every role, so the feature's public API is
|
|
171
|
+
identical whether the browser is local or behind a `parsek-cdp-server` proxy.
|
|
172
|
+
|
|
173
|
+
### Writing a custom feature — domain-like structure
|
|
174
|
+
|
|
175
|
+
A feature mirrors the layout of a generated CDP domain (`cdp/<domain>/` =
|
|
176
|
+
*types · functions · events*). Give it its own package with the same three
|
|
177
|
+
files, so the feature class doubles as its own namespace:
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
features/<feature>/
|
|
181
|
+
types.py # wire dataclasses + view types (@parsek_type)
|
|
182
|
+
events.py # aggregated Parsek.* events (@register_event)
|
|
183
|
+
__init__.py # the Feature class itself: domains + @on/@emit handlers
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
The building blocks (all from `parsek_cdp.core.feature`):
|
|
187
|
+
|
|
188
|
+
| Block | Where | What |
|
|
189
|
+
| --- | --- | --- |
|
|
190
|
+
| `domains = (Network, ...)` | feature class | CDP domains the feature owns — auto-enabled, and their raw events are suppressed from client passthrough |
|
|
191
|
+
| `@on(Event)` | method | register a handler. A **CDP** event makes it a *producer* (runs server/local); a **`Parsek.*`** event makes it a *reducer* (runs in every role) |
|
|
192
|
+
| `@emit(ParsekEvent)` | producer method | its return value is published to the client **and** reduced locally — so state is built by the same code path everywhere |
|
|
193
|
+
| `@parsek_type("Parsek.<Feature>.<Type>")` | `types.py` | declare a wire dataclass; `__FIELDS__` are derived from annotations (snake_case ↔ camelCase) |
|
|
194
|
+
| `@register_event("Parsek.<Feature>.<event>")` | `events.py` | declare an aggregated event class |
|
|
195
|
+
| `snapshot()` | feature class | state handed to a late-joining client (the server may replay it on connect) |
|
|
196
|
+
| `attach_namespace(Feat, types, events)` | end of `__init__.py` | expose the types/events as attributes on the feature class (`Feat.RequestData`, `Feat.RequestSent`, ...) |
|
|
197
|
+
|
|
198
|
+
Sketch — a producer that folds a raw CDP burst into one `Parsek.*` event, plus
|
|
199
|
+
the reducer that rebuilds state from it:
|
|
200
|
+
|
|
201
|
+
```python
|
|
202
|
+
# events.py
|
|
203
|
+
@register_event("Parsek.MyFeature.thing")
|
|
204
|
+
@dataclass
|
|
205
|
+
class ThingHappened(Event):
|
|
206
|
+
payload: ThingData
|
|
207
|
+
__FIELDS__ = (FieldMeta("payload", "payload", False, "object",
|
|
208
|
+
ref="Parsek.MyFeature.ThingData"),)
|
|
209
|
+
|
|
210
|
+
# __init__.py
|
|
211
|
+
class MyFeature(Feature):
|
|
212
|
+
domains = (SomeDomain,) # owned + auto-enabled
|
|
213
|
+
|
|
214
|
+
@on(SomeDomain.SomethingRaw) # CDP event -> producer
|
|
215
|
+
@emit(ThingHappened) # return is sent to client + reduced
|
|
216
|
+
def _produce(self, e) -> ThingHappened:
|
|
217
|
+
return ThingHappened(payload=ThingData(...))
|
|
218
|
+
|
|
219
|
+
@on(ThingHappened) # Parsek event -> reducer (both roles)
|
|
220
|
+
def _reduce(self, e: ThingHappened) -> None:
|
|
221
|
+
self._things.append(e.payload)
|
|
222
|
+
|
|
223
|
+
@property
|
|
224
|
+
def things(self): # the ergonomic public API
|
|
225
|
+
return list(self._things)
|
|
226
|
+
|
|
227
|
+
attach_namespace(MyFeature, _types, _events)
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
`RequestListener` (below) is the reference implementation of exactly this shape.
|
|
231
|
+
|
|
232
|
+
### `RequestListener`
|
|
233
|
+
|
|
234
|
+
The built-in feature: aggregated network observation. It records every request
|
|
235
|
+
of the current document with its response, headers and timing:
|
|
236
|
+
|
|
237
|
+
```python
|
|
238
|
+
requests = page.get_feature(RequestListener)
|
|
239
|
+
await page.navigate("https://example.com", wait_load=True)
|
|
240
|
+
|
|
241
|
+
# all requests of the current document
|
|
242
|
+
for r in requests.requests:
|
|
243
|
+
print(r.method, r.url, r.response.status_code)
|
|
244
|
+
|
|
245
|
+
# find / await a specific one (substring or compiled regex against the URL)
|
|
246
|
+
r = await requests.wait_for_response("/api/orders", timeout=30, load_body=True)
|
|
247
|
+
print(r.response.status_code, await r.response.body())
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
By default the log is cleared on main-frame navigation (like DevTools with
|
|
251
|
+
*Preserve log* off); pass `preserve_log=True` to keep it across documents.
|
|
252
|
+
|
|
253
|
+
## Remote browsers (with `parsek-cdp-server`)
|
|
254
|
+
|
|
255
|
+
Install the optional server distribution to launch and supervise browsers
|
|
256
|
+
behind a proxy:
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
pip install parsek-cdp[server]
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
Then connect to a running server instead of a local Chrome — the API is
|
|
263
|
+
identical, and the declared features are aggregated server-side:
|
|
264
|
+
|
|
265
|
+
```python
|
|
266
|
+
browser = await Browser[Page[RequestListener]].get_distant_browser(
|
|
267
|
+
"http://127.0.0.1:9333", headless=True
|
|
268
|
+
)
|
|
269
|
+
page = await browser.new_page("https://example.com")
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
See the [`parsek-cdp-server`](https://github.com/xa1era/parsek-cdp) package for
|
|
273
|
+
running the server, lifecycle supervision, metrics and the zombie reaper.
|
|
274
|
+
|
|
275
|
+
## License
|
|
276
|
+
|
|
277
|
+
Apache-2.0.
|