selenium README

README проекта с github.com/oss-invisible/selenium. Одним файлом markdown: README.md.

invisible_selenium, Selenium's API on an anti-detect Firefox. An animation: the import that changes, the fingerprint set inside the engine, a mouse that moves like a hand, and the options for a reproducible run.

Selenium gets caught by anti-bots and captchas.
This one runs on an anti-detect Firefox with an undetected fingerprint, compatible with your existing Selenium code.

Decodo residential proxies, free trial (sponsored)
Sponsored

How it works

Anti-bots ask two questions, and reCAPTCHA, hCaptcha and Cloudflare Turnstile score the answers. invisible_selenium answers yes to both.

1. Is this a real browser? Yes. It is Firefox, patched at the C++ source level.

2. Is a real person using it? Yes. The actions are humanized in the driver.


Install

Windows, in PowerShell:

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
$env:Path = "$env:USERPROFILE\.local\bin;$env:Path"
uv init --python ">=3.11" my-project
cd my-project
uv add invisible-selenium
uv run invisible-selenium fetch

Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh
source $HOME/.local/bin/env
uv init --python ">=3.11" my-project
cd my-project
uv add invisible-selenium
uv run invisible-selenium fetch

Supported platforms: Windows x86_64 / ARM64 (the x86_64 engine, under Windows' own emulation), Linux x86_64. Linux arm64 is no longer supported from firefox-56 (firefox-55 is the last engine built for it).

Then save one of the examples below as main.py in my-project and run it with uv run main.py.


Usage

Selenium's API, with no code changes. The same webdriver, By, WebDriverWait and expected_conditions. If you already use Selenium, switching is the import:

- from selenium import webdriver
- from selenium.webdriver.common.by import By
+ from invisible_selenium import webdriver
+ from invisible_selenium.webdriver.common.by import By
from invisible_selenium import webdriver
from invisible_selenium.webdriver.common.by import By
from invisible_selenium.webdriver.support.ui import WebDriverWait
from invisible_selenium.webdriver.support import expected_conditions as EC

driver = webdriver.Firefox()
driver.get("https://example.com")
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.TAG_NAME, "a"))).click()  # the mouse arcs to the link
print("seed =", driver.seed)   # log it to replay the run
driver.quit()

Every session gets a distinct fingerprint (GPU, audio, fonts, screen, ~200 fields). Do not install Selenium alongside it: this package already implements its API.

Options

driver = webdriver.Firefox(
    seed=42,                        # same seed, same fingerprint, every run
    proxy={"server": "socks5://host:1080", "username": "u", "password": "p"},
    timezone="America/New_York",    # default: derived from the proxy's exit IP
    pin={"screen.width": 2560, "screen.height": 1440},   # force fields, the rest stays seed-derived
    headless=True,                  # hidden desktop, real rendering: same fingerprint as headed
    profile_dir="./profile",        # cookies and storage survive the run
)

Proxies can be socks5, socks4, http or https, and DNS goes through them too. FirefoxOptions work as they do in Selenium, -headless included. The fields you can pin are the same as in invisible_playwright: pinning.

CLI

invisible-selenium fetch      # download the engine if missing, check every cached one, print the path
invisible-selenium version    # wrapper, core and engine versions

Switching from another tool?

Development

The setup and the test commands are in CONTRIBUTING.md.

License

MIT, see LICENSE. The Juggler client it drives the browser with lives in invisible-core, which carries two files taken from Playwright's driver under Apache-2.0. The patched Firefox binary is MPL-2.0, built from oss-invisible/firefox_antidetect_patch.

Disclaimer

This project is for educational purposes only. It is provided as-is, with no warranties. I take no responsibility for how it is used. Use it at your own risk and in compliance with the laws of your jurisdiction.


Built by Federico Elia  LinkedIn

tests License: MIT Python 3.11+

selenium (oss-invisible/selenium)

Ищем в базе…

Что это?Замена Selenium, работающая без переделки кода: она запускается на пропатченном на уровне C++ антидетект-Firefox с неотслеживаемым браузерным отпечатком и очеловеченными движениями мыши и вводом, поэтому антибот-системы и капчи (reCAPTCHA, hCaptcha, Cloudflare Turnstile) не распознают её как автоматизацию.
Это совершенно новый инструмент автоматизации или он работает с моим существующим кодом на Selenium?Это Python-библиотека, повторяющая API Selenium один в один (webdriver, By, WebDriverWait, expected_conditions), так что существующие скрипты на Selenium работают после замены одного импорта.
Как перевести существующие скрипты с Selenium?Замените импорт Selenium на invisible_selenium; FirefoxOptions, -headless и остальной API остаются прежними. Не держите Selenium установленным вместе с ним — этот пакет уже реализует его API.
Что нужно для запуска?Python 3.11 или новее, на Windows (x86-64 или ARM64 через собственную эмуляцию x86-64 в Windows) или Linux (x86-64 или arm64).
Можно ли спокойно полагаться на это в продакшене?Автор прямо называет проект учебным, поставляет его «как есть» без гарантий и не отвечает за то, как его используют — считайте это экспериментом, а не поддерживаемым продакшен-инструментом.
Как именно он обманывает детекцию ботов?Браузерный отпечаток (navigator, GPU/WebGL, canvas, шрифты, аудио, WebRTC, часовой пояс) задаётся внутри самого пропатченного движка Firefox, а не внедряется через JavaScript, а geckodriver/Marionette отсутствует, поэтому navigator.webdriver никогда не включается. Сверх того клики и перетаскивания идут по очеловеченным траекториям мыши с реалистичным таймингом.
Чем это отличается от selenium-stealth?selenium-stealth патчит страницу из JavaScript и не обновлялся с декабря 2021 года, а invisible_selenium патчит сам Firefox на уровне исходников C++.
Поддерживаются ли прокси?Да — поддерживаются прокси socks5, socks4, http и https, и разрешение DNS тоже идёт через них.
Есть ли версии для других фреймворков автоматизации?Да, тот же движок лежит в основе invisibleplaywright (API Playwright), invisiblepuppeteer (API Puppeteer на Python) и invisibleplaywrightmcp (доступ через MCP для ИИ-агентов).
Какие есть похожие проекты?puppeteer, ovobrowser, CloakBrowser, botasaurus, camofox-browser, playwright_mcp, camoufox, untidetect-tools
Автор
oss-invisible
Размер
13.1 MB
Звёзды
271
Возраст
2 г
Коммиты · 90 дней