{"id":17677722,"url":"https://github.com/kaliiiiiiiiii/selenium-profiles","last_synced_at":"2025-05-16T13:08:00.659Z","repository":{"id":63381488,"uuid":"562969035","full_name":"kaliiiiiiiiii/Selenium-Profiles","owner":"kaliiiiiiiiii","description":"undetected Selenium using chromedriver and emulation / device profiles","archived":false,"fork":false,"pushed_at":"2024-11-20T16:47:46.000Z","size":2449,"stargazers_count":306,"open_issues_count":6,"forks_count":30,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-05-11T00:27:10.070Z","etag":null,"topics":["automation","chromedebugprotocol","chromedriver","emulation","google-colaboratory","mobile-emulations","python","selenium","selenium-profiles","selenium-python","undetected-chromedriver","webautomation"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kaliiiiiiiiii.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-07T16:25:58.000Z","updated_at":"2025-05-08T01:25:26.000Z","dependencies_parsed_at":"2024-06-21T15:34:29.830Z","dependency_job_id":"feabc817-2bb0-4375-8dc9-ab13e441f316","html_url":"https://github.com/kaliiiiiiiiii/Selenium-Profiles","commit_stats":null,"previous_names":["kaliiiiiiiiii/selenium_profiles"],"tags_count":5,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaliiiiiiiiii%2FSelenium-Profiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaliiiiiiiiii%2FSelenium-Profiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaliiiiiiiiii%2FSelenium-Profiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaliiiiiiiiii%2FSelenium-Profiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaliiiiiiiiii","download_url":"https://codeload.github.com/kaliiiiiiiiii/Selenium-Profiles/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254535829,"owners_count":22087399,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","chromedebugprotocol","chromedriver","emulation","google-colaboratory","mobile-emulations","python","selenium","selenium-profiles","selenium-python","undetected-chromedriver","webautomation"],"created_at":"2024-10-24T07:41:41.622Z","updated_at":"2025-05-16T13:08:00.602Z","avatar_url":"https://github.com/kaliiiiiiiiii.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Selenium-Profiles\n\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/)\n\n* Overwrite **device metrics** using Selenium\n* Mobile and Desktop **emulation**\n* **Undetected** by Google, Cloudflare, creep-js using [selenium-driverless](#selenium-driverless)\n* [Modifying headers](#Modify-headers) supported using [Selenium-Interceptor](https://github.com/kaliiiiiiiiii/Selenium-Interceptor) or seleniumwire\n* [Touch Actions](#Touch_actions)\n* dynamic proxies with authentication\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))\n* headless unofficially supported\n* apply profile on already running driver with `driver.profiles.apply(profiles.Android())`\n* use of [seleniumwire](https://github.com/wkeeling/selenium-wire)\n\n## Sponsors\nThis project is currently not being sponsored.\n\nfor the latest features, have a look at the `dev` branch\n\n## Getting Started\n\n### Dependencies\n\n* [Python \u003e= 3.7](https://www.python.org/downloads/)\n* [Chrome-Browser](https://www.google.de/chrome/) installed\n\n### Installing\n\n* Install [Google-Chrome](https://www.google.de/chrome/) (or another chromium-based browser)\n* ```pip install selenium-profiles```\n\n### Start Driver\n\n```python\nfrom selenium_profiles.webdriver import Chrome\nfrom selenium_profiles.profiles import profiles\nfrom selenium.webdriver.common.by import By  # locate elements\nfrom seleniumwire import webdriver\n\n\nprofile = profiles.Windows() # or .Android\noptions = webdriver.ChromeOptions()\noptions.add_argument(\"--headless=new\")\ndriver = Chrome(profile, options=options,\n                uc_driver=False\n                )\n\n# get url\ndriver.get('https://abrahamjuliot.github.io/creepjs/')  # test fingerprint\n\ninput(\"Press ENTER to exit: \")\ndriver.quit()  # Execute on the End!\n```\n\nDon't forget to execute\n```driver.quit()```\nin the End. Else-wise your temporary folder will get flooded!\n\n#### Run with Google-Colab\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)__\n\n## Profiles\n\nExample Profile: \n```python\nprofile = \\\n{\n  \"options\": {\n      \"sandbox\": True,\n      \"headless\": False,\n      \"load_images\": True,\n      \"incognito\": True,\n      \"touch\": True,\n      \"app\": False,\n      \"gpu\": False,\n      \"proxy\": \"http://example-proxy.com:9000\", # note: auth not supported,\n      \"extension_paths\": [\"path/to/extension_1\", ...], # directory, .crx or .zip\n      \"args\": [\"--my-arg1\", ...],\n      \"capabilities\": {\"cap_1\":\"val_1\", \"cap_2\":\"val_2\"},\n      \"experimental_options\":{\"option1\":\"value1\", \"option2\":\"value2\"},\n      \"adb\": False, # run on harware device over ADB\n      \"adb_package\": \"com.android.chrome\",\n      \"use_running_app\": True\n  },\n  \"cdp\": {\n    \"touch\": True,\n    \"darkmode\":None,\n    \"maxtouchpoints\": 5,\n    \"cores\":8,\n    \"cdp_args\": [],\n    \"emulation\": {\"mobile\":True,\"width\": 384, \"height\": 700, \"deviceScaleFactor\": 10,\n        \"screenOrientation\": {\"type\": \"portrait-primary\", \"angle\": 0}},\n    \"patch_version\": True, # to patch automatically, or use \"111.0.5563.111\"\n    \"useragent\": {\n                \"platform\": \"Linux aarch64\",\n                \"acceptLanguage\":\"en-US\",\n                \"userAgent\": \"Mozilla/5.0 (Linux; Android 11; HD1913) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Mobile Safari/537.36\",\n                \"userAgentMetadata\": {\n                    \"brands\": [{\"brand\": \"Google Chrome\", \"version\": \"105\"}, {\"brand\": \"Not)A;Brand\", \"version\": \"8\"},\n                               {\"brand\": \"Chromium\", \"version\": \"105\"}],\n                    \"fullVersionList\": [{\"brand\": \"Google Chrome\", \"version\": \"105.0.5195.136\"},\n                                        {\"brand\": \"Not)A;Brand\", \"version\": \"8.0.0.0\"},\n                                        {\"brand\": \"Chromium\", \"version\": \"105.0.5195.136\"}],\n                    \"fullVersion\": \"105.0.5195.136\",\n                    \"platform\": \"Android\",\n                    \"platformVersion\": \"11.0.0\",\n                    \"architecture\": \"\",\n                    \"model\": \"HD1913\",\n                    \"mobile\": True,\n                    \"bitness\": \"\",\n                    \"wow64\": False}\n    }\n  },\n\"proxy\":{\n  \"proxy\":\"socks5://user1:pass@example_jost.com:5001\", \n  \"bypass_list\":[\"localhost\"]\n  }\n}\n```\n\n### selenium-driverless\nwarning: \n- this package is experimental and might include bugs, please report them at [bug-reports](https://github.com/kaliiiiiiiiii/Selenium-Driverless/issues)\n- might only work with 64-bit Python installations\n- profiles might make it detected\n- requires `pip install selenium-driverless\u003e=1.3.4` first\n```python\nfrom selenium_profiles.webdriver import Chrome\nfrom selenium_profiles.profiles import profiles\nfrom selenium_driverless.webdriver import ChromeOptions\nfrom selenium_driverless.types.by import By\n\nprofile = profiles.Windows()  # or .Android\noptions = ChromeOptions()\n# options.add_argument(\"--headless=new\")\ndriver = Chrome(profile, options=options, driverless_options=True)\n\n# get url\ndriver.get('https://nowsecure.nl#relax')  # test fingerprint\n\ndriver.quit()  # Execute on the End!\n```\nsee [documentation](https://github.com/kaliiiiiiiiii/Selenium-Driverless) for usages\n\n\n### Modify-headers\n\nusing selenium-wire\n```python\nfrom selenium_profiles import webdriver\nfrom selenium_profiles.profiles import profiles\n\nprofile = profiles.Android()\n\ndriver = webdriver.Chrome(profile, uc_driver=False, seleniumwire_options=True) # or pass seleniumwire-options\n\ndef interceptor(request):\n    request.headers['New-Header'] = 'Some Value'\ndriver.request_interceptor = interceptor\n\n# checkout headers\ndriver.get(\"https://httpbin.org/headers\")\n\ninput(\"Press ENTER to quit..\")\ndriver.quit()\nexit()\n```\n\nUsing [Selenium-Injector](https://github.com/kaliiiiiiiiii/Selenium-Injector)\n```python\nfrom selenium_profiles.webdriver import Chrome\n\ndriver = Chrome(injector_options=True)\ninjector = driver.profiles.injector\n\n# modify headers\ninjector.declarativeNetRequest.update_headers({\"test\": \"test_2\", \"sec-ch-ua-platform\": \"Android\"})\nrules = injector.declarativeNetRequest.dynamic_rules\nheaders = injector.declarativeNetRequest._headers\n\ndriver.get(\"https://httpbin.org/headers\")\ninput(\"press ENTER to continue\")\n\n# block images\ninjector.declarativeNetRequest.update_block_on(resource_types=[\"image\"])\n\ndriver.get(\"https://www.wikimedia.org/\")\n\ninput(\"press ENTER to exit\")\ndriver.quit()\n```\n\n### Touch_actions\n\nExample demonstration script\n```python\nfrom selenium_profiles.webdriver import Chrome\nfrom selenium_profiles.profiles import profiles\nfrom selenium.webdriver.common.by import By\nfrom selenium.webdriver import ChromeOptions\n\nfrom selenium_profiles.scripts.driver_utils import TouchActionChain\n\n\n# Start Driver\noptions = ChromeOptions()\nprofile = profiles.Android() # or .Windows()\n\ndriver = Chrome(profile, uc_driver=False, options=options)\n\n# initialise touch_actions\nchain = TouchActionChain(driver)\n\ndriver.get(\"https://cps-check.com/de/multi-touch-test\")\n\ntouch_box = driver.find_element(By.XPATH,'//*[@id=\"box\"]') # Get element\n\n\n\nchain.touch_and_hold(touch_box)\nchain.pause(10)\nchain.release(touch_box)\n\n# perform actions\nchain.perform()\n\n# now you should see a touch indication\n# point on the Website for 10 seconds\n\n# quit driver\ninput('Press ENTER to quit Driver\\n')\ndriver.quit()\n```\n\n### connect to running driver\nUndetectability isn't garanteed\n```python\nfrom selenium import  webdriver\ndriver = webdriver.Chrome()\n# driver allready started:)\n\n\nfrom selenium_profiles.webdriver import profiles as profile_manager\nfrom selenium_profiles.profiles import profiles\n\nprofile = profiles.Android() # or .Android()\ndriver.profiles = profile_manager(driver=driver, profile=profile)\ndriver.profiles.apply(profile)\n\ndriver.get('https://hmaker.github.io/selenium-detector/')  # test fingerprint\n\ninput(\"Press ENTER to exit\")\ndriver.quit()  # Execute on the End!\n```\n\n### Set proxies dynamically or with options\n```python\nfrom selenium_profiles.webdriver import Chrome\nfrom selenium_profiles.profiles import profiles\n\nprofile = profiles.Windows() # or .Android()\nprofile[\"proxy\"] = {\n  \"proxy\":\"http://user1:pass1@example_host.com:41149\"\n  }\n\ndriver = Chrome(profile=profile, injector_options=True)\n\ndriver.profiles.proxy.set_single(\"http://user2:pass2@example_host.com:41149\")\nprint(driver.profiles.proxy.proxy)\n\ndriver.quit()  # Execute on the End!\n```\n\n### To export a profile:\n\ngo to [https://js.do/kaliiiiiiiiiii/get_profile](https://js.do/kaliiiiiiiiiii/get_profile) in your browser and copy the text.\n\n## Help\n\nPlease feel free to open an issue or fork!\n\n## Known Bugs\n\n- [click_as_touch makes automation hung](https://github.com/kaliiiiiiiiii/Selenium-Profiles/issues/1)\n\n\n## Todo\n- [x] js-undetectability\n  - [ ] [`navigator.connection`]\n  - [ ] fonts don't match platform\n  - [ ] does not match worker scope (Emulation) [crbug#1358491](https://bugs.chromium.org/p/chromium/issues/detail?id=1358491)\n    - `Navigator.userAgent`\n    - `Navigator.platform`\n    - `navigator.hardwareConcurrency`\n  - [ ] emulation leak on new tabs [diskussion](https://github.com/kaliiiiiiiiii/Selenium-Profiles/discussions/50)\n  - [ ] [selenium-detector](https://github.com/HMaker/HMaker.github.io/blob/master/selenium-detector/chromedriver.js)\n    - [ ] Either Devtools Console is open or CDP Runtime Domain is enabled =\u003e patch javascript objects using a Proxy or disable CDP.Runtime domain?\n    - [ ] [document.$cdc_asdjflasutopfhvcZLmcfl_](https://source.chromium.org/chromium/chromium/src/+/main:chrome/test/chromedriver/js/call_function.js;l=219)\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)\n    - [ ] driver.execute_script() usage (needs hook on called element)\n    - [ ] driver.execute_async_script() usage (needs hook on called element)\n    - [ ] driver.find_element() usage\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)\n- [x] default metrics\n  - [x] Android\n  - [x] Windows\n  - [ ] IOS\n  - [ ] Linux\n  - [ ] Tablet\n- [ ] test.py script\n  - [x] test_driver.py\n    - [x] assert useragent, profile_export (no error)\n      - [x] Windows\n        - [x] useragent-data\n        - [ ] undetected\n          - [ ] headless\n      - [x] Android\n       - [x] useragent-data\n       - [ ] undetected\n         - [ ] headless\n\n\n## Deprecated\n\n* [Stealth method]((https://github.com/diprajpatra/selenium-stealth)) (Detected by Google)\n* [buster captcha solver](https://github.com/dessant/buster) | [wontfix](https://github.com/kaliiiiiiiiii/Selenium_Profiles/issues/3)\n\n\n## Authors\n\n[Aurin Aegerter](mailto:aurinliun@gmx.ch)\n\n## License\n\nShield: [![CC BY-NC-SA 4.0][cc-by-nc-sa-shield]][cc-by-nc-sa]\n\nThis work is licensed under a\n[Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License][cc-by-nc-sa].\n\n[![CC BY-NC-SA 4.0][cc-by-nc-sa-image]][cc-by-nc-sa]\n\n[cc-by-nc-sa]: http://creativecommons.org/licenses/by-nc-sa/4.0/\n[cc-by-nc-sa-image]: https://licensebuttons.net/l/by-nc-sa/4.0/88x31.png\n[cc-by-nc-sa-shield]: https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-lightgrey.svg\n\n## Disclaimer\n\nI am not responsible what you use the code for!!! Also no warranty!\n\n## Acknowledgments\n\nInspiration, code snippets, etc.\n\n* [Selenium](https://github.com/SeleniumHQ/selenium)\n* [selenium-documentation](https://www.selenium.dev/documentation/)\n* [README-Template](https://gist.github.com/DomPizzie/7a5ff55ffa9081f2de27c315f5018afc)\n* [headless_js](https://github.com/microlinkhq/browserless/tree/master/packages/goto/src/evasions)\n* [Selenium-Stealth](https://github.com/diprajpatra/selenium-stealth)\n* [Undetected-Chromedriver](https://github.com/ultrafunkamsterdam/undetected-chromedriver)\n* [Selenium-Wire](https://github.com/wkeeling/selenium-wire)\n* [Modheader-Selenium](https://github.com/modheader/modheader_selenium)\n* [ModHeader docs](https://docs.modheader.com/advanced/selenium-webdriver)\n* [buster captcha solver](https://github.com/dessant/buster) | [wontfix](https://github.com/kaliiiiiiiiii/Selenium-Profiles/issues/3)\n* [audio_captcha_solver](https://github.com/najmi9/solve-recaptcha-python-selenium/blob/master/main.py)\n* [Chromedriver-Options List](https://peter.sh/experiments/chromium-command-line-switches/)\n* [Chrome DevTools Protocol (cdp_cmd)](https://chromedevtools.github.io/devtools-protocol/1-3/)\n* [example_pypi_package](https://github.com/tomchen/example_pypi_package)\n* [google-colab installer](https://github.com/ultrafunkamsterdam/undetected-chromedriver/issues/108)\n* [scripts/touch_action_chain](https://www.reddit.com/r/Appium/comments/rbx1r2/touchaction_deprecated_please_use_w3c_i_stead/)\n* [cdp_event_listeners](https://stackoverflow.com/questions/66227508/selenium-4-0-0-beta-1-how-add-event-listeners-in-cdp)\n* [proxy-auth](https://github.com/Smartproxy/Selenium-proxy-authentication)\n* [webdriver-manager](https://github.com/SergeyPirogov/webdriver_manager)\n* [dynamic subclasses](https://stackoverflow.com/a/9270908/20443541)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaliiiiiiiiii%2Fselenium-profiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaliiiiiiiiii%2Fselenium-profiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaliiiiiiiiii%2Fselenium-profiles/lists"}