Selenium-Interceptor
- Modifying or adding headers
- Modify response
Feel free to test my code!
Getting Started
Dependencies
- Python >= 3.7
- Chrome-Browser installed
- Selenium
Installing
- [Windows] Install Chrome-Browser
pip install selenium_interceptor
Change-headers
from selenium_interceptor.interceptor import cdp_listener
from selenium_profiles import driver as mydriver
from selenium_profiles.profiles import profiles
mydriver = mydriver()
profile = profiles.Windows()
driver = mydriver.start(profile)
cdp_listener = cdp_listener(driver=driver)
cdp_listener.specify_headers({"sec-ch-ua-platform":"Android"})
thread = cdp_listener.start_threaded(listener={"listener": cdp_listener.requests, "at_event": cdp_listener.modify_headers})
driver.get("https://modheader.com/headers?product=ModHeader")
Don't forget to execute
cdp_listener.terminate_all()
in the End. Else-wise your temporary folder will get flooded! (Windows) and it keeps running
Help
Please feel free to open an issue or fork!
Todo
Deprecated
Authors
License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Disclaimer
I am not responsible what you use the code for!!! Also no warranty!
Acknowledgments
Inspiration, code snippets, etc.
Metadata
Release files for selenium-interceptor 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| selenium_interceptor-1.0.2.tar.gz | 6.3 kB | Without provenance | Details for selenium_interceptor-1.0.2.tar.gz |
Release files / selenium_interceptor-1.0.2.tar.gz
| Download URL | selenium_interceptor-1.0.2.tar.gz |
|---|---|
| Size | 6.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e6410f743484e875d285da6fb9238b825ba76ae4efbbc5c6b9a3a45d2a6c4d39
|
|
BLAKE2b-256 checksum How to use checksums |
f24aec8229dfd7b06363afa49a2dffb3809b080c8f9ebe710e6ae592d5f20f42
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.7.9
|
Security for selenium-interceptor 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.