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.
pip install splinterVerified import paths — ran on the pinned version, not inferred.
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`.
Ensure your project runs on Python 3.x.
Update your `pip install` command to include the desired Selenium extra, e.g., `pip install splinter[selenium4]`.
Replace calls to the deprecated methods with `element.is_visible()` or `element.is_not_visible()` on the `WebDriverElement` object.
Be aware of the new default behavior. If you intend to delete specific cookies, ensure you pass the relevant arguments to `delete()`.
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.
Install Splinter with the appropriate Selenium extra: `pip install splinter[selenium4]` (recommended) or `pip install splinter[selenium3]`.
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()`.
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.
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.