Intercept requests using Selenium with Chrome
Project description
Selenium-Interceptor
- Modifying or adding headers(#Change-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
driver.quit()
in the End. Else-wise your temporary folder will get flooded! (Windows)
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for selenium_interceptor-1.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0dfd18f04d4eb7d009f6725f4f903e5d2b2c5b4250678fd4f83362f339bb1ff9 |
|
MD5 | 0b1bd2c365aa47afcb2828b525fd48bd |
|
BLAKE2b-256 | 9f3d0b22955ea7fff6b2c2328d309e834c14310c5ff09b37b32eadf7b0182b87 |