{"id":13571563,"url":"https://github.com/diprajpatra/selenium-stealth","last_synced_at":"2025-04-04T08:31:34.671Z","repository":{"id":39699198,"uuid":"309057015","full_name":"diprajpatra/selenium-stealth","owner":"diprajpatra","description":"Trying to make python selenium more stealthy.","archived":false,"fork":false,"pushed_at":"2021-12-30T14:57:26.000Z","size":1981,"stargazers_count":678,"open_issues_count":36,"forks_count":92,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-03-06T21:16:16.430Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/diprajpatra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-01T09:55:39.000Z","updated_at":"2025-03-02T16:06:43.000Z","dependencies_parsed_at":"2022-07-13T12:10:49.287Z","dependency_job_id":null,"html_url":"https://github.com/diprajpatra/selenium-stealth","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diprajpatra%2Fselenium-stealth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diprajpatra%2Fselenium-stealth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diprajpatra%2Fselenium-stealth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diprajpatra%2Fselenium-stealth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/diprajpatra","download_url":"https://codeload.github.com/diprajpatra/selenium-stealth/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247147304,"owners_count":20891669,"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":[],"created_at":"2024-08-01T14:01:03.233Z","updated_at":"2025-04-04T08:31:29.661Z","avatar_url":"https://github.com/diprajpatra.png","language":"Python","funding_links":["https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif","https://paypal.me/diprajpatra","https://www.buymeacoffee.com/dipraj"],"categories":["Python","Anti-Bot Solutions"],"sub_categories":["Browser Fingerprinting"],"readme":"# selenium-stealth [![Build Status](https://travis-ci.com/diprajpatra/selenium-stealth.svg?branch=main)](https://travis-ci.com/diprajpatra/selenium-stealth)\n\nA python package **selenium-stealth** to prevent detection. This programme is trying to make python selenium more stealthy. \n\nAs of now selenium-stealth **only support Selenium Chrome/Chromium**.\n\nAfter using selenium-stealth you can prevent almost all selenium detections. There is a lot of guides on stackoverflow on How to prevent selenium detection but I can not find a single python package for it so I am just creating one after all we can't let the cats win.\nIt can be seen as a re-implementation of JavaScript [puppeteer-extra-plugin-stealth](https://github.com/berstend/puppeteer-extra/tree/master/packages/puppeteer-extra-plugin-stealth) developed by [@berstend](https://github.com/berstend\u003e).\n\nFeatures that currently selenium-stealth can offer:\n\n- ✅️ **`selenium-stealth` with stealth passes all public bot tests.**\n\n- ✅️ **With `selenium-stealth` selenium can do google account login.**\n\n- ✅️ **`selenium-stealth` help with maintaining a normal reCAPTCHA v3 score**\n\n## Donations\nIf you find this package useful and would like to support its continued development, you can donate here. Thank you for your support.\n\n[![Donate Via PayPal](https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif)](https://paypal.me/diprajpatra)\n\n[\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png\"  width=\"120\" height=\"30\"\u003e](https://www.buymeacoffee.com/dipraj)\n## Install\nSelenium-stealth is available on PyPI you can install with pip.\n```\n$ pip install selenium-stealth\n```\n\n## Usage\n\n```python\nfrom selenium import webdriver\nfrom selenium_stealth import stealth\nimport time\n\noptions = webdriver.ChromeOptions()\noptions.add_argument(\"start-maximized\")\n\n# options.add_argument(\"--headless\")\n\noptions.add_experimental_option(\"excludeSwitches\", [\"enable-automation\"])\noptions.add_experimental_option('useAutomationExtension', False)\ndriver = webdriver.Chrome(options=options, executable_path=r\"C:\\Users\\DIPRAJ\\Programming\\adclick_bot\\chromedriver.exe\")\n\nstealth(driver,\n        languages=[\"en-US\", \"en\"],\n        vendor=\"Google Inc.\",\n        platform=\"Win32\",\n        webgl_vendor=\"Intel Inc.\",\n        renderer=\"Intel Iris OpenGL Engine\",\n        fix_hairline=True,\n        )\n\nurl = \"https://bot.sannysoft.com/\"\ndriver.get(url)\ntime.sleep(5)\ndriver.quit()\n```\n\n## Args\n\n```python\nstealth(\n    driver: Driver,\n    user_agent: str = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.53 Safari/537.36',\n    languages: [str] = [\"en-US\", \"en\"],\n    vendor: str = \"Google Inc.\",\n    platform: str = \"Win32\",\n    webgl_vendor: str = \"Intel Inc.\",\n    renderer: str = \"Intel Iris OpenGL Engine\",\n    fix_hairline: bool = False,\n    run_on_insecure_origins: bool = False,\n)\n```\n\n## Test results (red is bad)\n\n### Selenium without \u003cstrong\u003eselenium-stealth 😢\u003c/strong\u003e\n\n\u003ctable class=\"image\"\u003e\n\u003ctr\u003e\n  \u003ctd\u003e\u003cfigure class=\"image\"\u003e\u003ca href=\"https://raw.githubusercontent.com/diprajpatra/selenium-stealth/main/stealthtests/selenium_chrome_headless_without_stealth.png\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/diprajpatra/selenium-stealth/main/stealthtests/selenium_chrome_headless_without_stealth.png\"\u003e\u003c/a\u003e\u003cfigcaption\u003eheadless\u003c/figcaption\u003e\u003c/figure\u003e\u003c/td\u003e\n  \u003ctd\u003e\u003cfigure class=\"image\"\u003e\u003ca href=\"https://raw.githubusercontent.com/diprajpatra/selenium-stealth/main/stealthtests/selenium_chrome_headful_without_stealth.png\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/diprajpatra/selenium-stealth/main/stealthtests/selenium_chrome_headful_without_stealth.png\"\u003e\u003c/a\u003e\u003cfigcaption\u003eheadful\u003c/figcaption\u003e\u003c/figure\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n### Selenium with \u003cstrong\u003eselenium-stealth 💯\u003c/strong\u003e\n\n\u003ctable class=\"image\"\u003e\n\u003ctr\u003e\n  \u003ctd\u003e\u003cfigure class=\"image\"\u003e\u003ca href=\"https://raw.githubusercontent.com/diprajpatra/selenium-stealth/main/stealthtests/selenium_chrome_headless_with_stealth.png\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/diprajpatra/selenium-stealth/main/stealthtests/selenium_chrome_headless_with_stealth.png\"\u003e\u003c/a\u003e\u003cfigcaption\u003eheadless\u003c/figcaption\u003e\u003c/figure\u003e\u003c/td\u003e\n  \u003ctd\u003e\u003cfigure class=\"image\"\u003e\u003ca href=\"https://raw.githubusercontent.com/diprajpatra/selenium-stealth/main/stealthtests/selenium_chrome_headful_with_stealth.png\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/diprajpatra/selenium-stealth/main/stealthtests/selenium_chrome_headful_with_stealth.png\"\u003e\u003c/a\u003e\u003cfigcaption\u003eheadful\u003c/figcaption\u003e\u003c/figure\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n## License\n\nCopyright © 2020, [diprajpatra](https://github.com/diprajpatra). Released under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiprajpatra%2Fselenium-stealth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiprajpatra%2Fselenium-stealth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiprajpatra%2Fselenium-stealth/lists"}