{"id":7746,"library":"splinter","title":"Splinter","description":"Splinter is a Python library that provides a high-level browser abstraction for web acceptance testing and browser automation. It supports multiple drivers including Selenium (for Chrome, Firefox, Edge, etc.) and offers a consistent API to interact with web elements, forms, and pages. It is actively maintained with regular feature releases and bug fixes, typically every few months. The current stable version is 0.21.0.","status":"active","version":"0.21.0","language":"en","source_language":"en","source_url":"https://github.com/cobrateam/splinter/","tags":["web testing","browser automation","acceptance testing","selenium","headless browser","e2e testing"],"install":[{"cmd":"pip install splinter","lang":"bash","label":"Base installation"},{"cmd":"pip install splinter[selenium4]","lang":"bash","label":"With Selenium 4 support (recommended)"},{"cmd":"pip install splinter[selenium3]","lang":"bash","label":"With Selenium 3 support (for older projects)"}],"dependencies":[{"reason":"Required for most real browser automation drivers (e.g., Chrome, Firefox). Not a direct 'install_requires' dependency since v0.17.0; must be installed via extras or separately.","package":"selenium","optional":false},{"reason":"Highly recommended for automatically downloading and managing browser drivers (e.g., chromedriver, geckodriver).","package":"webdriver-manager","optional":true}],"imports":[{"symbol":"Browser","correct":"from splinter import Browser"}],"quickstart":{"code":"from splinter import Browser\nimport os\n\n# Optional: Use webdriver-manager to automatically download/manage drivers\n# from webdriver_manager.chrome import ChromeDriverManager\n# driver_path = ChromeDriverManager().install()\n\n# Create a Browser instance\n# Common options: 'chrome', 'firefox', 'edge'\n# headless=True is recommended for CI/CD or background tasks\nbrowser = Browser('chrome', headless=True) # Or 'firefox', 'edge', etc.\n\ntry:\n    browser.visit('http://quotes.toscrape.com/login')\n\n    print(f\"Visiting: {browser.url}\")\n    browser.fill('username', 'admin')\n    browser.fill('password', 'password')\n    browser.find_by_css('input[type=\"submit\"]').click()\n\n    if browser.is_text_present('Logged in!'):\n        print(f\"Successfully logged in. Current URL: {browser.url}\")\n        browser.click_link_by_text('Logout')\n        assert browser.is_text_present('Login')\n        print(\"Successfully logged out.\")\n    else:\n        print(\"Login failed.\")\n\nexcept Exception as e:\n    print(f\"An error occurred during the test: {e}\")\nfinally:\n    if browser:\n        browser.quit() # Always close the browser","lang":"python","description":"This quickstart demonstrates how to initialize a headless Chrome browser, navigate to a URL, fill out a login form, click a button, and assert text presence. It includes error handling and ensures the browser is closed properly. For Chrome/Firefox, ensure the respective driver (e.g., chromedriver, geckodriver) is in your system's PATH or managed by a tool like `webdriver-manager`."},"warnings":[{"fix":"Ensure your project runs on Python 3.x.","message":"Python 2.7 support was removed. Splinter v0.17.0 and later only support Python 3.","severity":"breaking","affected_versions":">=0.17.0"},{"fix":"Update your `pip install` command to include the desired Selenium extra, e.g., `pip install splinter[selenium4]`.","message":"Selenium 3 is no longer installed by default since v0.17.0. Users must explicitly install either `splinter[selenium3]` or `splinter[selenium4]` (recommended).","severity":"breaking","affected_versions":">=0.17.0"},{"fix":"Replace calls to the deprecated methods with `element.is_visible()` or `element.is_not_visible()` on the `WebDriverElement` object.","message":"The methods `WebDriver.is_element_not_visible_by_css` and `WebDriver.is_element_visible_by_css` were deprecated in favor of `WebDriverElement.is_visible()` and `WebDriverElement.is_not_visible()`.","severity":"deprecated","affected_versions":">=0.19.0"},{"fix":"Be aware of the new default behavior. If you intend to delete specific cookies, ensure you pass the relevant arguments to `delete()`.","message":"Calling `CookieManager.delete()` without any arguments now deletes *all* cookies. Prior to v0.19.0, its behavior when called without arguments might have been different or unclear.","severity":"gotcha","affected_versions":">=0.19.0"},{"fix":"Always install Splinter with the appropriate Selenium extra (`splinter[selenium3]` or `splinter[selenium4]`) and ensure your `selenium` package version is compatible with your Splinter version. If using `webdriver-manager`, ensure it's up to date.","message":"Compatibility issues can arise from mismatched Splinter and Selenium versions. For example, Splinter v0.16.0 pinned Selenium < 4.0, while v0.17.0 added Selenium 4 support.","severity":"gotcha","affected_versions":"0.16.0-0.17.0"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Install Splinter with the appropriate Selenium extra: `pip install splinter[selenium4]` (recommended) or `pip install splinter[selenium3]`.","cause":"Splinter was installed without the necessary `selenium` dependency. Since v0.17.0, `selenium` is no longer installed by default.","error":"ModuleNotFoundError: No module named 'selenium'"},{"fix":"Download the correct driver for your browser version and operating system, then either place it in a directory listed in your system's PATH, or provide its path explicitly during browser initialization. Alternatively, use `webdriver-manager` to automate this: `pip install webdriver-manager` and then `from webdriver_manager.chrome import ChromeDriverManager; driver_path = ChromeDriverManager().install()`.","cause":"The browser driver executable (e.g., `geckodriver` for Firefox, `chromedriver` for Chrome, `msedgedriver` for Edge) is not found in your system's PATH.","error":"WebDriverException: Message: 'geckodriver' executable needs to be in PATH."},{"fix":"Ensure you are using the `splinter.Browser` object (e.g., `browser.find_by_css(...)`) for Splinter's API. If the method still doesn't exist, check the official Splinter documentation for its availability in your version.","cause":"You might be attempting to call Splinter methods directly on the underlying `selenium.webdriver` object instead of the `splinter.Browser` instance, or you're using a method that doesn't exist in your installed Splinter version.","error":"AttributeError: 'WebDriver' object has no attribute 'find_by_css' (or similar method)"},{"fix":"Update your ChromeDriver executable to match your installed Chrome browser version. Using `webdriver_manager.chrome.ChromeDriverManager().install()` (or similar for other browsers) is the easiest way to keep drivers automatically updated.","cause":"There is a mismatch between the version of your Chrome browser and the version of ChromeDriver installed/used.","error":"selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version XX"}]}