Use one Splinter browser session, visit each URL in a loop, wait for the page content you need, and save each screenshot under a distinct filename. If you see “Connection refused,” first identify the host and port in the full error: the failed connection may be between Python and a local WebDriver, between your client and a remote WebDriver, or from the browser to the website. Those are different problems and need different fixes.
Capture multiple pages with one Splinter browser session
The example below creates an output directory, opens one Chrome session, visits each URL, waits for a page-specific element, and saves one image per page. It uses Selenium’s explicit wait rather than assuming that navigation means all asynchronous content has rendered.
Splinter documents its browser context-manager pattern and the visit method. The screenshot arguments shown in Splinter’s cited documentation come from version 0.18.0; check your installed version before relying on the exact signature or behavior. The example is a practical template, not a tested recipe. See Splinter 0.18.0 browser documentation and the Splinter Chrome driver documentation.
from pathlib import Path
from urllib.parse import urlparse
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from splinter import Browser
urls = [
"https://example.com/one",
"https://example.com/two",
]
output_dir = Path("screenshots")
output_dir.mkdir(parents=True, exist_ok=True)
with Browser("chrome", headless=True) as browser:
for index, url in enumerate(urls, start=1):
browser.visit(url)
# Wait for a meaningful page condition. Replace this with an element
# that is present when the content you need is ready.
WebDriverWait(browser.driver, 20).until(
EC.presence_of_element_located((By.TAG_NAME, "body"))
)
host = urlparse(url).hostname or "page"
safe_host = "".join(c if c.isalnum() or c in "-._" else "_" for c in host)
filename = output_dir / f"page-{index:03d}-{safe_host}"
browser.screenshot(name=str(filename), unique_file=False)
The body wait only confirms that a body element exists; it does not prove that a single-page application, image, or delayed widget has finished rendering. For a capture that depends on specific content, wait for that content’s selector or another observable condition. Selenium describes poor synchronization as its most common class of error in its troubleshooting documentation.
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
Why one browser instance and numbered filenames?
- A single browser session avoids restarting the browser for every URL. It also makes session setup and cleanup straightforward.
- The loop calls
browser.visit(url)once for each destination. - The numeric index prevents different URLs with the same hostname from overwriting one another. The hostname is sanitized for a readable filename.
- The context manager closes the browser when execution leaves the block, including when an exception interrupts the loop.
Screenshot scope and output
Splinter’s documented screenshot method accepts a name and suffix, a full flag, and a unique_file option; it returns the screenshot path. Set filenames deliberately and check the returned path if you need to log or verify output. Do not assume full=True means a consistent full-page capture in every driver and version; support and semantics can depend on the browser integration. Consult the documentation for your installed Splinter version before choosing capture scope.
The example uses an extensionless base name because the documented method accepts a suffix separately. If your installed version requires or defaults to a particular suffix, set it explicitly according to that version’s API. Keep the output directory separate from your source files and ensure the Python process has write permission there.
Choose a readiness condition that matches the screenshot
Browser navigation and visual readiness are not the same event. A page can return control while JavaScript is still fetching or rendering content. A fixed delay can help determine whether timing is involved, but it is a fragile final synchronization strategy: slow pages may need longer, while fast pages waste time.
Prefer a condition-based wait
Use a selector that appears when the portion you need is ready:
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteRank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
WebDriverWait(browser.driver, 20).until(
EC.visibility_of_element_located((By.CSS_SELECTOR, "main article"))
)
Choose presence when an element need only exist in the DOM, visibility when it must be displayed, or a more specific condition when the screenshot depends on a state change. For a page with lazy-loaded images, scrolling or otherwise triggering their loading may be necessary before capture; the exact behavior depends on the site and browser.
Use a delay only as a diagnostic
If adding a short wait makes an inconsistent capture work, that is evidence timing may be involved, not proof of the correct final delay. Replace it with a condition that expresses the content or state required. When no stable page-specific selector exists, a delay may be the only practical fallback, but document that it is an approximation and adjust it for the execution environment.
Diagnose “Connection Refused” by the endpoint
The words alone do not identify the cause. Read the complete traceback and find the refused host, port, and operation. In a browser-automation workflow, at least three separate connections can fail:
| Connection | What to inspect | Useful next step |
|---|---|---|
| Python process to local WebDriver or ChromeDriver | Whether the driver service starts, which executable and port are configured, and whether the browser can be launched. | Check the driver path and service configuration. Splinter documents accepting Selenium’s Service object and a custom ChromeDriver executable path in its Chrome driver documentation. |
| Python/Selenium client to remote WebDriver | The remote endpoint, service status, route, port, and network reachability. | Confirm the configured URL and that the remote service is listening and reachable from the client environment. |
| Browser to target website | Whether the URL is correct, whether one site or many fail, and whether the browser’s network can reach the destination. | Check the address and site availability, then investigate the browser environment, network, firewall, or site-specific behavior. |
A successful WebDriver session proves that Python can control a browser; it does not prove the browser can reach a particular site. Likewise, a website loading in your regular browser does not prove that a separate container, server, or remote browser has the same network access.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Inspect the exception before changing settings
- Record the complete traceback, not only the final “connection refused” phrase.
- Identify the hostname or IP address and port named in the failing connection.
- Note when it fails: while creating the browser, navigating to a URL, waiting for content, or after a session has been closed.
- Check whether the same failure occurs for every URL or only one target.
- Only then change the corresponding driver, remote endpoint, or target-site/network configuration.
A community report of a “Failed to establish a new connection” message does not establish a general cause. Treat the endpoint and traceback from your own run as the evidence for diagnosis.
Check Chrome, ChromeDriver, and session lifecycle
When the refusal happens during browser creation or control, verify that the configured Chrome binary and ChromeDriver executable exist where the process expects them. If you use a custom driver service or executable path, confirm that the path is valid in the environment that runs Python—not merely on your workstation. Splinter’s Chrome documentation describes service and path configuration.
Check that Chrome and ChromeDriver are compatible. Selenium’s troubleshooting guidance recommends checking the browser version and obtaining a matching ChromeDriver: Selenium WebDriver errors. Installed browser versions can change independently of a Python package, especially in containers or managed machines, so include both browser and driver versions when diagnosing a reproducible failure.
If the exception instead says the session is invalid or deleted, inspect the session lifecycle. Calling close() or quit() and then reusing the same session can produce session errors; a closed browser window or changed browsing context can also invalidate assumptions in later code. Keep navigation and captures inside the context-manager block, or use a try/finally cleanup pattern when you manage the session manually.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Separate one-site failures from broad network failures
If one URL fails while others work in the same browser, check for a typo, redirect, site outage, access restriction, or site-specific network behavior before changing ChromeDriver configuration. If many unrelated sites fail, investigate broader network access, DNS, firewall or antivirus rules, proxy configuration, and the machine or container’s connectivity. Google Chrome Help lists device settings, firewall or antivirus, network problems, browser cookies or extensions, memory use, and site downtime among possible causes of Chrome loading errors: Fix connection and loading errors in Chrome.
Compare like with like: test a known reachable URL from the same browser environment, not only from a different desktop browser. A local machine, CI runner, container, and remote WebDriver host may have different network routes and restrictions.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Local and remote WebDriver: what changes
With a local browser, Python typically controls a driver service on the same machine or execution environment. A refusal at that stage points toward service startup, executable configuration, or the local service endpoint. With a remote browser, there is an additional network hop: the client must reach the configured WebDriver server, and that server must in turn be able to start and control its browser.
For remote setups, verify the endpoint from the client host, check that the service is running on the intended route and port, and confirm that network rules permit the connection. Then separately confirm the remote browser can reach the target website. These checks distinguish a client-to-WebDriver failure from a browser-to-site failure.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Run ChromeDriver with appropriate security controls
ChromeDriver is a powerful browser-control interface. Chrome for Developers says it allows local connections by default and recommends restricting remote access to allowed IPs, running without a privileged account, using a protected environment, and protecting related network ports. Keep Chrome and ChromeDriver current, and do not expose a driver endpoint publicly without deliberate access controls. See ChromeDriver security considerations.
Common failures and practical fixes
| Symptom | Likely area to investigate | Action |
|---|---|---|
| Refusal occurs while creating the browser | Local driver service, executable path, browser binary, or service configuration. | Verify the configured paths and service startup in the same environment that runs the script. Check browser and driver compatibility. |
| Refusal names a remote host or port | Remote WebDriver endpoint or network route. | Check the endpoint value, remote service status, firewall rules, and reachability from the client. |
| WebDriver starts, but one destination does not load | Target URL, site availability, or browser-to-site access. | Validate the URL and test other sites from the same automated browser environment. |
| Several unrelated destinations fail | Broader network, proxy, DNS, or firewall conditions. | Check connectivity from the machine or container running the browser and review network policy. |
| Screenshot is blank or misses content | Capture ran before the required content rendered, or the chosen capture scope does not match expectations. | Wait for a meaningful selector or state; verify the screenshot API and full-page behavior for the installed driver version. |
| Later loop iterations report an invalid or deleted session | The browser or window was closed, or the session was otherwise ended before reuse. | Keep operations inside the browser context and do not reuse a closed session. |
| Files are missing or overwrite one another | Output path, process permissions, or non-unique names. | Create the directory, check write permissions, and include an index or other unique page identifier. |
Or skip the browser setup
If your goal is to obtain screenshots rather than operate Splinter, ScreenshotNeo is a website screenshot API and MCP server for developers. A single GET request can return a PNG, JPEG, WebP, or PDF. See the ScreenshotNeo API documentation for request options.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com/one -o shot.webp
The output filename in this example is shot.webp; use request options documented by the service when you need a different format or capture behavior. ScreenshotNeo accepts cookie or consent banners as a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; those steps can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers report the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents and MCP clients.
The free plan includes 1,000 screenshots per month with no card required; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account to start with 1,000 screenshots a month and no card.
Free tools Windows power users keep installed
One-click scans. No signup required.
Operational notes for batches
For a modest list, a sequential loop is easy to inspect: each URL is processed in order, and a failure can be tied to the current index and address. Log the index and URL before navigation if you need to identify which page failed. Decide whether one page’s failure should stop the batch or be caught and recorded so later pages can continue; if you catch exceptions, retain the traceback and mark that page as failed rather than silently treating it as a successful screenshot.
Do not assume a fixed runtime for a batch. Total time depends on navigation, site responsiveness, the wait condition, browser startup, and any images or scripts the page loads. Reusing one session avoids repeated browser startup in the loop, but a long-running session can also accumulate state such as cookies or tabs if your code creates them. Keep the browser lifecycle and per-page state intentional.
Frequently Asked Questions
What information should I include when asking for help with a refused connection?
Include the full traceback, the refused host and port, where in the workflow it occurs, your local or remote WebDriver setup, and the installed Splinter, Selenium, Chrome, and ChromeDriver versions.
Does Splinter’s `full=True` guarantee a full-page screenshot?
No universal guarantee is established across drivers and versions. Confirm what the screenshot option does for your installed Splinter and browser combination.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

