# Selenium-Profiles
[![Downloads](https://static.pepy.tech/badge/selenium-profiles)](https://pepy.tech/project/selenium-profiles) [![](https://img.shields.io/pypi/v/selenium-profiles.svg?color=3399EE)](https://pypi.org/project/selenium-profiles/)
* Overwrite **device metrics** using Selenium
* Mobile and Desktop **emulation**
* **Undetected** by Google, Cloudflare, creep-js using [selenium-driverless](#selenium-driverless)
* [Modifying headers](#Modify-headers) supported using [Selenium-Interceptor](https://github.com/kaliiiiiiiiii/Selenium-Interceptor) or seleniumwire
* [Touch Actions](#Touch_actions)
* dynamic proxies with authentication
* making single [POST](https://github.com/kaliiiiiiiiii/Selenium-Profiles/discussions/11#discussioncomment-4797109), GET or other requests using `driver.profiles.fetch(url)` ([syntax](https://developer.mozilla.org/en-US/docs/Web/API/fetch#syntax))
* headless unofficially supported
* apply profile on already running driver with `driver.profiles.apply(profiles.Android())`
* use of [seleniumwire](https://github.com/wkeeling/selenium-wire)
for the latest features, have a look at the `dev` branch
### Feel free to test my code!
## Getting Started
### Dependencies
* [Python >= 3.7](https://www.python.org/downloads/)
* [Chrome-Browser](https://www.google.de/chrome/) installed
### Installing
* Install [Google-Chrome](https://www.google.de/chrome/) (or another chromium-based browser)
* ```pip install selenium-profiles```
### Start Driver
```python
from selenium_profiles.webdriver import Chrome
from selenium_profiles.profiles import profiles
from selenium.webdriver.common.by import By # locate elements
from seleniumwire import webdriver
profile = profiles.Windows() # or .Android
options = webdriver.ChromeOptions()
options.add_argument("--headless=new")
driver = Chrome(profile, options=options,
uc_driver=False
)
# get url
driver.get('https://abrahamjuliot.github.io/creepjs/') # test fingerprint
input("Press ENTER to exit: ")
driver.quit() # Execute on the End!
```
Don't forget to execute
```driver.quit()```
in the End. Else-wise your temporary folder will get flooded!
#### Run with Google-Colab
__[Google-Colab](https://colab.research.google.com/github/kaliiiiiiiiii/Selenium-Profiles/blob/master/google-colab/selenium_profiles.ipynb) (file: master@google-colab/selenium_profiles.ipynb)__
## Profiles
Example Profile:
```python
profile = \
{
"options": {
"sandbox": True,
"headless": False,
"load_images": True,
"incognito": True,
"touch": True,
"app": False,
"gpu": False,
"proxy": "http://example-proxy.com:9000", # note: auth not supported,
"extension_paths": ["path/to/extension_1", ...], # directory, .crx or .zip
"args": ["--my-arg1", ...],
"capabilities": {"cap_1":"val_1", "cap_2":"val_2"},
"experimental_options":{"option1":"value1", "option2":"value2"},
"adb": False, # run on harware device over ADB
"adb_package": "com.android.chrome",
"use_running_app": True
},
"cdp": {
"touch": True,
"darkmode":None,
"maxtouchpoints": 5,
"cores":8,
"cdp_args": [],
"emulation": {"mobile":True,"width": 384, "height": 700, "deviceScaleFactor": 10,
"screenOrientation": {"type": "portrait-primary", "angle": 0}},
"patch_version": True, # to patch automatically, or use "111.0.5563.111"
"useragent": {
"platform": "Linux aarch64",
"acceptLanguage":"en-US",
"userAgent": "Mozilla/5.0 (Linux; Android 11; HD1913) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Mobile Safari/537.36",
"userAgentMetadata": {
"brands": [{"brand": "Google Chrome", "version": "105"}, {"brand": "Not)A;Brand", "version": "8"},
{"brand": "Chromium", "version": "105"}],
"fullVersionList": [{"brand": "Google Chrome", "version": "105.0.5195.136"},
{"brand": "Not)A;Brand", "version": "8.0.0.0"},
{"brand": "Chromium", "version": "105.0.5195.136"}],
"fullVersion": "105.0.5195.136",
"platform": "Android",
"platformVersion": "11.0.0",
"architecture": "",
"model": "HD1913",
"mobile": True,
"bitness": "",
"wow64": False}
}
},
"proxy":{
"proxy":"socks5://user1:pass@example_jost.com:5001",
"bypass_list":["localhost"]
}
}
```
### selenium-driverless
warning:
- this package is experimental and might include bugs, please report them at [bug-reports](https://github.com/kaliiiiiiiiii/Selenium-Driverless/issues)
- might only work with 64-bit Python installations
- profiles might make it detected
- requires `pip install selenium-driverless>=1.3.4` first
```python
from selenium_profiles.webdriver import Chrome
from selenium_profiles.profiles import profiles
from selenium_driverless.webdriver import ChromeOptions
from selenium_driverless.types.by import By
profile = profiles.Windows() # or .Android
options = ChromeOptions()
# options.add_argument("--headless=new")
driver = Chrome(profile, options=options, driverless_options=True)
# get url
driver.get('https://nowsecure.nl#relax') # test fingerprint
driver.quit() # Execute on the End!
```
see [documentation](https://github.com/kaliiiiiiiiii/Selenium-Driverless) for usages
### Modify-headers
using selenium-wire
```python
from selenium_profiles import webdriver
from selenium_profiles.profiles import profiles
profile = profiles.Android()
driver = webdriver.Chrome(profile, uc_driver=False, seleniumwire_options=True) # or pass seleniumwire-options
def interceptor(request):
request.headers['New-Header'] = 'Some Value'
driver.request_interceptor = interceptor
# checkout headers
driver.get("https://httpbin.org/headers")
input("Press ENTER to quit..")
driver.quit()
exit()
```
Using [Selenium-Injector](https://github.com/kaliiiiiiiiii/Selenium-Injector)
```python
from selenium_profiles.webdriver import Chrome
driver = Chrome(injector_options=True)
injector = driver.profiles.injector
# modify headers
injector.declarativeNetRequest.update_headers({"test": "test_2", "sec-ch-ua-platform": "Android"})
rules = injector.declarativeNetRequest.dynamic_rules
headers = injector.declarativeNetRequest._headers
driver.get("https://httpbin.org/headers")
input("press ENTER to continue")
# block images
injector.declarativeNetRequest.update_block_on(resource_types=["image"])
driver.get("https://www.wikimedia.org/")
input("press ENTER to exit")
driver.quit()
```
### Touch_actions
Example demonstration script
```python
from selenium_profiles.webdriver import Chrome
from selenium_profiles.profiles import profiles
from selenium.webdriver.common.by import By
from selenium.webdriver import ChromeOptions
from selenium_profiles.scripts.driver_utils import TouchActionChain
# Start Driver
options = ChromeOptions()
profile = profiles.Android() # or .Windows()
driver = Chrome(profile, uc_driver=False, options=options)
# initialise touch_actions
chain = TouchActionChain(driver)
driver.get("https://cps-check.com/de/multi-touch-test")
touch_box = driver.find_element(By.XPATH,'//*[@id="box"]') # Get element
chain.touch_and_hold(touch_box)
chain.pause(10)
chain.release(touch_box)
# perform actions
chain.perform()
# now you should see a touch indication
# point on the Website for 10 seconds
# quit driver
input('Press ENTER to quit Driver\n')
driver.quit()
```
### connect to running driver
Undetectability isn't garanteed
```python
from selenium import webdriver
driver = webdriver.Chrome()
# driver allready started:)
from selenium_profiles.webdriver import profiles as profile_manager
from selenium_profiles.profiles import profiles
profile = profiles.Android() # or .Android()
driver.profiles = profile_manager(driver=driver, profile=profile)
driver.profiles.apply(profile)
driver.get('https://hmaker.github.io/selenium-detector/') # test fingerprint
input("Press ENTER to exit")
driver.quit() # Execute on the End!
```
### Set proxies dynamically or with options
```python
from selenium_profiles.webdriver import Chrome
from selenium_profiles.profiles import profiles
profile = profiles.Windows() # or .Android()
profile["proxy"] = {
"proxy":"http://user1:pass1@example_host.com:41149"
}
driver = Chrome(profile=profile, injector_options=True)
driver.profiles.proxy.set_single("http://user2:pass2@example_host.com:41149")
print(driver.profiles.proxy.proxy)
driver.quit() # Execute on the End!
```
### To export a profile:
go to [https://js.do/kaliiiiiiiiiii/get_profile](https://js.do/kaliiiiiiiiiii/get_profile) in your browser and copy the text.
## Help
Please feel free to open an issue or fork!
## Known Bugs
- [click_as_touch makes automation hung](https://github.com/kaliiiiiiiiii/Selenium-Profiles/issues/1)
## Todo
- [x] js-undetectability
- [ ] [`navigator.connection`]
- [ ] fonts don't match platform
- [ ] does not match worker scope (Emulation) [crbug#1358491](https://bugs.chromium.org/p/chromium/issues/detail?id=1358491)
- `Navigator.userAgent`
- `Navigator.platform`
- `navigator.hardwareConcurrency`
- [ ] emulation leak on new tabs [diskussion](https://github.com/kaliiiiiiiiii/Selenium-Profiles/discussions/50)
- [ ] [selenium-detector](https://github.com/HMaker/HMaker.github.io/blob/master/selenium-detector/chromedriver.js)
- [ ] Either Devtools Console is open or CDP Runtime Domain is enabled => patch javascript objects using a Proxy or disable CDP.Runtime domain?
- [ ] [document.$cdc_asdjflasutopfhvcZLmcfl_](https://source.chromium.org/chromium/chromium/src/+/main:chrome/test/chromedriver/js/call_function.js;l=219)
- [ ] [`document.$chrome_asyncScriptInfo`](https://source.chromium.org/chromium/chromium/src/+/main:chrome/test/chromedriver/chrome/web_view_impl.cc;l=1586-1597;drc=2e14a3ac178ee87aa9154e5a15dcd986af1b6059)
- [ ] driver.execute_script() usage (needs hook on called element)
- [ ] driver.execute_async_script() usage (needs hook on called element)
- [ ] driver.find_element() usage
- [x] [`window.cdc_adoQpoasnfa76pfcZLmcfl`](https://source.chromium.org/chromium/chromium/src/+/main:chrome/test/chromedriver/chrome/devtools_client_impl.cc;l=526-532;drc=f915006bb8e09e0c29016cf9ab9e737cdebc1adc)
- [x] default metrics
- [x] Android
- [x] Windows
- [ ] IOS
- [ ] Linux
- [ ] Tablet
- [ ] test.py script
- [x] test_driver.py
- [x] assert useragent, profile_export (no error)
- [x] Windows
- [x] useragent-data
- [ ] undetected
- [ ] headless
- [x] Android
- [x] useragent-data
- [ ] undetected
- [ ] headless
## Deprecated
* [Stealth method]((https://github.com/diprajpatra/selenium-stealth)) (Detected by Google)
* [buster captcha solver](https://github.com/dessant/buster) | [wontfix](https://github.com/kaliiiiiiiiii/Selenium_Profiles/issues/3)
## Authors
[Aurin Aegerter](mailto:aurinliun@gmx.ch)
## License
Shield: [![CC BY-NC-SA 4.0][cc-by-nc-sa-shield]][cc-by-nc-sa]
This work is licensed under a
[Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License][cc-by-nc-sa].
[![CC BY-NC-SA 4.0][cc-by-nc-sa-image]][cc-by-nc-sa]
[cc-by-nc-sa]: http://creativecommons.org/licenses/by-nc-sa/4.0/
[cc-by-nc-sa-image]: https://licensebuttons.net/l/by-nc-sa/4.0/88x31.png
[cc-by-nc-sa-shield]: https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-lightgrey.svg
## Disclaimer
I am not responsible what you use the code for!!! Also no warranty!
## Acknowledgments
Inspiration, code snippets, etc.
* [Selenium](https://github.com/SeleniumHQ/selenium)
* [selenium-documentation](https://www.selenium.dev/documentation/)
* [README-Template](https://gist.github.com/DomPizzie/7a5ff55ffa9081f2de27c315f5018afc)
* [headless_js](https://github.com/microlinkhq/browserless/tree/master/packages/goto/src/evasions)
* [Selenium-Stealth](https://github.com/diprajpatra/selenium-stealth)
* [Undetected-Chromedriver](https://github.com/ultrafunkamsterdam/undetected-chromedriver)
* [Selenium-Wire](https://github.com/wkeeling/selenium-wire)
* [Modheader-Selenium](https://github.com/modheader/modheader_selenium)
* [ModHeader docs](https://docs.modheader.com/advanced/selenium-webdriver)
* [buster captcha solver](https://github.com/dessant/buster) | [wontfix](https://github.com/kaliiiiiiiiii/Selenium-Profiles/issues/3)
* [audio_captcha_solver](https://github.com/najmi9/solve-recaptcha-python-selenium/blob/master/main.py)
* [Chromedriver-Options List](https://peter.sh/experiments/chromium-command-line-switches/)
* [Chrome DevTools Protocol (cdp_cmd)](https://chromedevtools.github.io/devtools-protocol/1-3/)
* [example_pypi_package](https://github.com/tomchen/example_pypi_package)
* [google-colab installer](https://github.com/ultrafunkamsterdam/undetected-chromedriver/issues/108)
* [scripts/touch_action_chain](https://www.reddit.com/r/Appium/comments/rbx1r2/touchaction_deprecated_please_use_w3c_i_stead/)
* [cdp_event_listeners](https://stackoverflow.com/questions/66227508/selenium-4-0-0-beta-1-how-add-event-listeners-in-cdp)
* [proxy-auth](https://github.com/Smartproxy/Selenium-proxy-authentication)
* [webdriver-manager](https://github.com/SergeyPirogov/webdriver_manager)
* [dynamic subclasses](https://stackoverflow.com/a/9270908/20443541)
Raw data
{
"_id": null,
"home_page": "https://github.com/kaliiiiiiiiii/Selenium_Profiles",
"name": "selenium-profiles",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "Selenium,emulation,automation,undetected-chromedriver,webautomation",
"author": "Aurin Aegerter",
"author_email": "aurinliun@gmx.ch",
"download_url": "https://files.pythonhosted.org/packages/d1/82/99772a2f5951bd62de5e871056c374322aa951301503c065f001ea33cbbe/selenium_profiles-2.2.10.tar.gz",
"platform": null,
"description": "# Selenium-Profiles\r\n\r\n[![Downloads](https://static.pepy.tech/badge/selenium-profiles)](https://pepy.tech/project/selenium-profiles) [![](https://img.shields.io/pypi/v/selenium-profiles.svg?color=3399EE)](https://pypi.org/project/selenium-profiles/)\r\n\r\n* Overwrite **device metrics** using Selenium\r\n* Mobile and Desktop **emulation**\r\n* **Undetected** by Google, Cloudflare, creep-js using [selenium-driverless](#selenium-driverless)\r\n* [Modifying headers](#Modify-headers) supported using [Selenium-Interceptor](https://github.com/kaliiiiiiiiii/Selenium-Interceptor) or seleniumwire\r\n* [Touch Actions](#Touch_actions)\r\n* dynamic proxies with authentication\r\n* making single [POST](https://github.com/kaliiiiiiiiii/Selenium-Profiles/discussions/11#discussioncomment-4797109), GET or other requests using `driver.profiles.fetch(url)` ([syntax](https://developer.mozilla.org/en-US/docs/Web/API/fetch#syntax))\r\n* headless unofficially supported\r\n* apply profile on already running driver with `driver.profiles.apply(profiles.Android())`\r\n* use of [seleniumwire](https://github.com/wkeeling/selenium-wire)\r\n\r\nfor the latest features, have a look at the `dev` branch\r\n\r\n### Feel free to test my code!\r\n\r\n## Getting Started\r\n\r\n### Dependencies\r\n\r\n* [Python >= 3.7](https://www.python.org/downloads/)\r\n* [Chrome-Browser](https://www.google.de/chrome/) installed\r\n\r\n### Installing\r\n\r\n* Install [Google-Chrome](https://www.google.de/chrome/) (or another chromium-based browser)\r\n* ```pip install selenium-profiles```\r\n\r\n### Start Driver\r\n\r\n```python\r\nfrom selenium_profiles.webdriver import Chrome\r\nfrom selenium_profiles.profiles import profiles\r\nfrom selenium.webdriver.common.by import By # locate elements\r\nfrom seleniumwire import webdriver\r\n\r\n\r\nprofile = profiles.Windows() # or .Android\r\noptions = webdriver.ChromeOptions()\r\noptions.add_argument(\"--headless=new\")\r\ndriver = Chrome(profile, options=options,\r\n uc_driver=False\r\n )\r\n\r\n# get url\r\ndriver.get('https://abrahamjuliot.github.io/creepjs/') # test fingerprint\r\n\r\ninput(\"Press ENTER to exit: \")\r\ndriver.quit() # Execute on the End!\r\n```\r\n\r\nDon't forget to execute\r\n```driver.quit()```\r\nin the End. Else-wise your temporary folder will get flooded!\r\n\r\n#### Run with Google-Colab\r\n__[Google-Colab](https://colab.research.google.com/github/kaliiiiiiiiii/Selenium-Profiles/blob/master/google-colab/selenium_profiles.ipynb) (file: master@google-colab/selenium_profiles.ipynb)__\r\n\r\n## Profiles\r\n\r\nExample Profile: \r\n```python\r\nprofile = \\\r\n{\r\n \"options\": {\r\n \"sandbox\": True,\r\n \"headless\": False,\r\n \"load_images\": True,\r\n \"incognito\": True,\r\n \"touch\": True,\r\n \"app\": False,\r\n \"gpu\": False,\r\n \"proxy\": \"http://example-proxy.com:9000\", # note: auth not supported,\r\n \"extension_paths\": [\"path/to/extension_1\", ...], # directory, .crx or .zip\r\n \"args\": [\"--my-arg1\", ...],\r\n \"capabilities\": {\"cap_1\":\"val_1\", \"cap_2\":\"val_2\"},\r\n \"experimental_options\":{\"option1\":\"value1\", \"option2\":\"value2\"},\r\n \"adb\": False, # run on harware device over ADB\r\n \"adb_package\": \"com.android.chrome\",\r\n \"use_running_app\": True\r\n },\r\n \"cdp\": {\r\n \"touch\": True,\r\n \"darkmode\":None,\r\n \"maxtouchpoints\": 5,\r\n \"cores\":8,\r\n \"cdp_args\": [],\r\n \"emulation\": {\"mobile\":True,\"width\": 384, \"height\": 700, \"deviceScaleFactor\": 10,\r\n \"screenOrientation\": {\"type\": \"portrait-primary\", \"angle\": 0}},\r\n \"patch_version\": True, # to patch automatically, or use \"111.0.5563.111\"\r\n \"useragent\": {\r\n \"platform\": \"Linux aarch64\",\r\n \"acceptLanguage\":\"en-US\",\r\n \"userAgent\": \"Mozilla/5.0 (Linux; Android 11; HD1913) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Mobile Safari/537.36\",\r\n \"userAgentMetadata\": {\r\n \"brands\": [{\"brand\": \"Google Chrome\", \"version\": \"105\"}, {\"brand\": \"Not)A;Brand\", \"version\": \"8\"},\r\n {\"brand\": \"Chromium\", \"version\": \"105\"}],\r\n \"fullVersionList\": [{\"brand\": \"Google Chrome\", \"version\": \"105.0.5195.136\"},\r\n {\"brand\": \"Not)A;Brand\", \"version\": \"8.0.0.0\"},\r\n {\"brand\": \"Chromium\", \"version\": \"105.0.5195.136\"}],\r\n \"fullVersion\": \"105.0.5195.136\",\r\n \"platform\": \"Android\",\r\n \"platformVersion\": \"11.0.0\",\r\n \"architecture\": \"\",\r\n \"model\": \"HD1913\",\r\n \"mobile\": True,\r\n \"bitness\": \"\",\r\n \"wow64\": False}\r\n }\r\n },\r\n\"proxy\":{\r\n \"proxy\":\"socks5://user1:pass@example_jost.com:5001\", \r\n \"bypass_list\":[\"localhost\"]\r\n }\r\n}\r\n```\r\n\r\n### selenium-driverless\r\nwarning: \r\n- this package is experimental and might include bugs, please report them at [bug-reports](https://github.com/kaliiiiiiiiii/Selenium-Driverless/issues)\r\n- might only work with 64-bit Python installations\r\n- profiles might make it detected\r\n- requires `pip install selenium-driverless>=1.3.4` first\r\n```python\r\nfrom selenium_profiles.webdriver import Chrome\r\nfrom selenium_profiles.profiles import profiles\r\nfrom selenium_driverless.webdriver import ChromeOptions\r\nfrom selenium_driverless.types.by import By\r\n\r\nprofile = profiles.Windows() # or .Android\r\noptions = ChromeOptions()\r\n# options.add_argument(\"--headless=new\")\r\ndriver = Chrome(profile, options=options, driverless_options=True)\r\n\r\n# get url\r\ndriver.get('https://nowsecure.nl#relax') # test fingerprint\r\n\r\ndriver.quit() # Execute on the End!\r\n```\r\nsee [documentation](https://github.com/kaliiiiiiiiii/Selenium-Driverless) for usages\r\n\r\n\r\n### Modify-headers\r\n\r\nusing selenium-wire\r\n```python\r\nfrom selenium_profiles import webdriver\r\nfrom selenium_profiles.profiles import profiles\r\n\r\nprofile = profiles.Android()\r\n\r\ndriver = webdriver.Chrome(profile, uc_driver=False, seleniumwire_options=True) # or pass seleniumwire-options\r\n\r\ndef interceptor(request):\r\n request.headers['New-Header'] = 'Some Value'\r\ndriver.request_interceptor = interceptor\r\n\r\n# checkout headers\r\ndriver.get(\"https://httpbin.org/headers\")\r\n\r\ninput(\"Press ENTER to quit..\")\r\ndriver.quit()\r\nexit()\r\n```\r\n\r\nUsing [Selenium-Injector](https://github.com/kaliiiiiiiiii/Selenium-Injector)\r\n```python\r\nfrom selenium_profiles.webdriver import Chrome\r\n\r\ndriver = Chrome(injector_options=True)\r\ninjector = driver.profiles.injector\r\n\r\n# modify headers\r\ninjector.declarativeNetRequest.update_headers({\"test\": \"test_2\", \"sec-ch-ua-platform\": \"Android\"})\r\nrules = injector.declarativeNetRequest.dynamic_rules\r\nheaders = injector.declarativeNetRequest._headers\r\n\r\ndriver.get(\"https://httpbin.org/headers\")\r\ninput(\"press ENTER to continue\")\r\n\r\n# block images\r\ninjector.declarativeNetRequest.update_block_on(resource_types=[\"image\"])\r\n\r\ndriver.get(\"https://www.wikimedia.org/\")\r\n\r\ninput(\"press ENTER to exit\")\r\ndriver.quit()\r\n```\r\n\r\n### Touch_actions\r\n\r\nExample demonstration script\r\n```python\r\nfrom selenium_profiles.webdriver import Chrome\r\nfrom selenium_profiles.profiles import profiles\r\nfrom selenium.webdriver.common.by import By\r\nfrom selenium.webdriver import ChromeOptions\r\n\r\nfrom selenium_profiles.scripts.driver_utils import TouchActionChain\r\n\r\n\r\n# Start Driver\r\noptions = ChromeOptions()\r\nprofile = profiles.Android() # or .Windows()\r\n\r\ndriver = Chrome(profile, uc_driver=False, options=options)\r\n\r\n# initialise touch_actions\r\nchain = TouchActionChain(driver)\r\n\r\ndriver.get(\"https://cps-check.com/de/multi-touch-test\")\r\n\r\ntouch_box = driver.find_element(By.XPATH,'//*[@id=\"box\"]') # Get element\r\n\r\n\r\n\r\nchain.touch_and_hold(touch_box)\r\nchain.pause(10)\r\nchain.release(touch_box)\r\n\r\n# perform actions\r\nchain.perform()\r\n\r\n# now you should see a touch indication\r\n# point on the Website for 10 seconds\r\n\r\n# quit driver\r\ninput('Press ENTER to quit Driver\\n')\r\ndriver.quit()\r\n```\r\n\r\n### connect to running driver\r\nUndetectability isn't garanteed\r\n```python\r\nfrom selenium import webdriver\r\ndriver = webdriver.Chrome()\r\n# driver allready started:)\r\n\r\n\r\nfrom selenium_profiles.webdriver import profiles as profile_manager\r\nfrom selenium_profiles.profiles import profiles\r\n\r\nprofile = profiles.Android() # or .Android()\r\ndriver.profiles = profile_manager(driver=driver, profile=profile)\r\ndriver.profiles.apply(profile)\r\n\r\ndriver.get('https://hmaker.github.io/selenium-detector/') # test fingerprint\r\n\r\ninput(\"Press ENTER to exit\")\r\ndriver.quit() # Execute on the End!\r\n```\r\n\r\n### Set proxies dynamically or with options\r\n```python\r\nfrom selenium_profiles.webdriver import Chrome\r\nfrom selenium_profiles.profiles import profiles\r\n\r\nprofile = profiles.Windows() # or .Android()\r\nprofile[\"proxy\"] = {\r\n \"proxy\":\"http://user1:pass1@example_host.com:41149\"\r\n }\r\n\r\ndriver = Chrome(profile=profile, injector_options=True)\r\n\r\ndriver.profiles.proxy.set_single(\"http://user2:pass2@example_host.com:41149\")\r\nprint(driver.profiles.proxy.proxy)\r\n\r\ndriver.quit() # Execute on the End!\r\n```\r\n\r\n### To export a profile:\r\n\r\ngo to [https://js.do/kaliiiiiiiiiii/get_profile](https://js.do/kaliiiiiiiiiii/get_profile) in your browser and copy the text.\r\n\r\n## Help\r\n\r\nPlease feel free to open an issue or fork!\r\n\r\n## Known Bugs\r\n\r\n- [click_as_touch makes automation hung](https://github.com/kaliiiiiiiiii/Selenium-Profiles/issues/1)\r\n\r\n\r\n## Todo\r\n- [x] js-undetectability\r\n - [ ] [`navigator.connection`]\r\n - [ ] fonts don't match platform\r\n - [ ] does not match worker scope (Emulation) [crbug#1358491](https://bugs.chromium.org/p/chromium/issues/detail?id=1358491)\r\n - `Navigator.userAgent`\r\n - `Navigator.platform`\r\n - `navigator.hardwareConcurrency`\r\n - [ ] emulation leak on new tabs [diskussion](https://github.com/kaliiiiiiiiii/Selenium-Profiles/discussions/50)\r\n - [ ] [selenium-detector](https://github.com/HMaker/HMaker.github.io/blob/master/selenium-detector/chromedriver.js)\r\n - [ ] Either Devtools Console is open or CDP Runtime Domain is enabled => patch javascript objects using a Proxy or disable CDP.Runtime domain?\r\n - [ ] [document.$cdc_asdjflasutopfhvcZLmcfl_](https://source.chromium.org/chromium/chromium/src/+/main:chrome/test/chromedriver/js/call_function.js;l=219)\r\n - [ ] [`document.$chrome_asyncScriptInfo`](https://source.chromium.org/chromium/chromium/src/+/main:chrome/test/chromedriver/chrome/web_view_impl.cc;l=1586-1597;drc=2e14a3ac178ee87aa9154e5a15dcd986af1b6059)\r\n - [ ] driver.execute_script() usage (needs hook on called element)\r\n - [ ] driver.execute_async_script() usage (needs hook on called element)\r\n - [ ] driver.find_element() usage\r\n - [x] [`window.cdc_adoQpoasnfa76pfcZLmcfl`](https://source.chromium.org/chromium/chromium/src/+/main:chrome/test/chromedriver/chrome/devtools_client_impl.cc;l=526-532;drc=f915006bb8e09e0c29016cf9ab9e737cdebc1adc)\r\n- [x] default metrics\r\n - [x] Android\r\n - [x] Windows\r\n - [ ] IOS\r\n - [ ] Linux\r\n - [ ] Tablet\r\n- [ ] test.py script\r\n - [x] test_driver.py\r\n - [x] assert useragent, profile_export (no error)\r\n - [x] Windows\r\n - [x] useragent-data\r\n - [ ] undetected\r\n - [ ] headless\r\n - [x] Android\r\n - [x] useragent-data\r\n - [ ] undetected\r\n - [ ] headless\r\n\r\n\r\n## Deprecated\r\n\r\n* [Stealth method]((https://github.com/diprajpatra/selenium-stealth)) (Detected by Google)\r\n* [buster captcha solver](https://github.com/dessant/buster) | [wontfix](https://github.com/kaliiiiiiiiii/Selenium_Profiles/issues/3)\r\n\r\n\r\n## Authors\r\n\r\n[Aurin Aegerter](mailto:aurinliun@gmx.ch)\r\n\r\n## License\r\n\r\nShield: [![CC BY-NC-SA 4.0][cc-by-nc-sa-shield]][cc-by-nc-sa]\r\n\r\nThis work is licensed under a\r\n[Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License][cc-by-nc-sa].\r\n\r\n[![CC BY-NC-SA 4.0][cc-by-nc-sa-image]][cc-by-nc-sa]\r\n\r\n[cc-by-nc-sa]: http://creativecommons.org/licenses/by-nc-sa/4.0/\r\n[cc-by-nc-sa-image]: https://licensebuttons.net/l/by-nc-sa/4.0/88x31.png\r\n[cc-by-nc-sa-shield]: https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-lightgrey.svg\r\n\r\n## Disclaimer\r\n\r\nI am not responsible what you use the code for!!! Also no warranty!\r\n\r\n## Acknowledgments\r\n\r\nInspiration, code snippets, etc.\r\n\r\n* [Selenium](https://github.com/SeleniumHQ/selenium)\r\n* [selenium-documentation](https://www.selenium.dev/documentation/)\r\n* [README-Template](https://gist.github.com/DomPizzie/7a5ff55ffa9081f2de27c315f5018afc)\r\n* [headless_js](https://github.com/microlinkhq/browserless/tree/master/packages/goto/src/evasions)\r\n* [Selenium-Stealth](https://github.com/diprajpatra/selenium-stealth)\r\n* [Undetected-Chromedriver](https://github.com/ultrafunkamsterdam/undetected-chromedriver)\r\n* [Selenium-Wire](https://github.com/wkeeling/selenium-wire)\r\n* [Modheader-Selenium](https://github.com/modheader/modheader_selenium)\r\n* [ModHeader docs](https://docs.modheader.com/advanced/selenium-webdriver)\r\n* [buster captcha solver](https://github.com/dessant/buster) | [wontfix](https://github.com/kaliiiiiiiiii/Selenium-Profiles/issues/3)\r\n* [audio_captcha_solver](https://github.com/najmi9/solve-recaptcha-python-selenium/blob/master/main.py)\r\n* [Chromedriver-Options List](https://peter.sh/experiments/chromium-command-line-switches/)\r\n* [Chrome DevTools Protocol (cdp_cmd)](https://chromedevtools.github.io/devtools-protocol/1-3/)\r\n* [example_pypi_package](https://github.com/tomchen/example_pypi_package)\r\n* [google-colab installer](https://github.com/ultrafunkamsterdam/undetected-chromedriver/issues/108)\r\n* [scripts/touch_action_chain](https://www.reddit.com/r/Appium/comments/rbx1r2/touchaction_deprecated_please_use_w3c_i_stead/)\r\n* [cdp_event_listeners](https://stackoverflow.com/questions/66227508/selenium-4-0-0-beta-1-how-add-event-listeners-in-cdp)\r\n* [proxy-auth](https://github.com/Smartproxy/Selenium-proxy-authentication)\r\n* [webdriver-manager](https://github.com/SergeyPirogov/webdriver_manager)\r\n* [dynamic subclasses](https://stackoverflow.com/a/9270908/20443541)\r\n",
"bugtrack_url": null,
"license": "",
"summary": "Emulate and Automate Chrome using Profiles and Selenium",
"version": "2.2.10",
"project_urls": {
"Bug Reports": "https://github.com/kaliiiiiiiiii/Selenium_Profiles/issues",
"Documentation": "https://github.com/kaliiiiiiiiii/Selenium_Profiles",
"Homepage": "https://github.com/kaliiiiiiiiii/Selenium_Profiles",
"Source Code": "https://github.com/kaliiiiiiiiii/Selenium_Profiles"
},
"split_keywords": [
"selenium",
"emulation",
"automation",
"undetected-chromedriver",
"webautomation"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d18299772a2f5951bd62de5e871056c374322aa951301503c065f001ea33cbbe",
"md5": "2c252e02f34feedfd5a4f7357cada786",
"sha256": "d2bb5c60c76c025f36bca62617875bc97dc2541cb25730e2dba50a3ddac95857"
},
"downloads": -1,
"filename": "selenium_profiles-2.2.10.tar.gz",
"has_sig": false,
"md5_digest": "2c252e02f34feedfd5a4f7357cada786",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 30121,
"upload_time": "2023-08-19T23:55:00",
"upload_time_iso_8601": "2023-08-19T23:55:00.372234Z",
"url": "https://files.pythonhosted.org/packages/d1/82/99772a2f5951bd62de5e871056c374322aa951301503c065f001ea33cbbe/selenium_profiles-2.2.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-19 23:55:00",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "kaliiiiiiiiii",
"github_project": "Selenium_Profiles",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "selenium-profiles"
}