Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
A strip that looks like a browser title bar in the middle of a Selenium screenshot is not proof that Selenium added browser chrome. First find out whether it is page content, an iframe, native browser UI, or a mismatch between the capture region and the viewport. Then choose the screenshot method for the output you actually want: the visible window, a particular element, or content beyond the viewport.
Selenium’s Python Chromium API documents driver screenshots as captures of the current window, and Selenium separately documents element screenshots. Chrome’s DevTools Protocol offers a region clip and a captureBeyondViewport option. None of those interfaces establishes one universal cause for every mid-image strip; the precise diagnosis depends on your browser, binding, run mode, dimensions, and capture call.
What the “title bar” might be
People use “title bar” to describe several visually similar things. It might be a fixed page header that stays in view while scrolling, a sticky navigation bar, content rendered inside an iframe, an application component designed to resemble browser chrome, or actual native window UI. It can also appear to be misplaced because the screenshot captures a different region or extent than expected.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Start by comparing the image with the live browser at the same scroll position. If text or graphics on the strip correspond to a page element, inspect its DOM position and CSS. If the strip is in an iframe, remember that the frame is a separate browsing context. If it has no page element counterpart, investigate the capture method and runtime rather than assuming Selenium inserted it.
Selenium’s official Python API describes driver screenshots as screenshots of the current window: Chromium WebDriver API. Its separate element-screenshot interface is documented at WebElement API.
#1 Best Overall
Diagnose the strip before changing the capture
- Compare with the live page. Keep the same tab and scroll position, then determine whether the strip is visible in the browser page itself.
- Check the DOM and CSS. Search for matching text or inspect likely header elements. Look for fixed or sticky positioning and establish whether the element belongs to the top-level document or an iframe.
- Confirm the active tab and window. Switch to the intended WebDriver window handle before capturing. Selenium documents window and tab switching in its window interactions guide.
- Record the capture target and dimensions. Note the screenshot call, browser and driver versions, binding/version, headed or headless mode, window and viewport dimensions, device scale if applicable, and scroll position.
- Reproduce in the exact runtime. Capture after navigation and rendering have settled. The wait required depends on the page; a page with asynchronous content may need a condition tied to that content rather than an arbitrary pause.
These checks distinguish a page element from capture geometry. The official interfaces establish available targets and controls, but they cannot identify the source of an individual screenshot artifact without the runtime details and image.
Choose the right Selenium screenshot target
| Desired result | Capture path | Key consideration |
|---|---|---|
| Visible current window | WebDriver screenshot | Check that the current window and its content area are the ones intended. |
| One page component | WebElement screenshot | Locate the intended element, including the correct frame context. |
| Defined Chrome region or beyond-viewport content | Chrome DevTools Protocol screenshot | Set clip coordinates and beyond-viewport behavior deliberately; this is Chrome-specific. |
Capture the current window
For a normal viewport image, use the WebDriver screenshot operation. Selenium’s Python Chromium API documents save_screenshot for writing a PNG and get_screenshot_as_png for screenshot bytes. The exact content captured can depend on runtime and window geometry, so compare the result with the actual page content area rather than treating “window” as a promise about native UI across every platform.
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 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchfrom selenium import webdriver
options = webdriver.ChromeOptions()
# Add options required by your own runtime here.
driver = webdriver.Chrome(options=options)
try:
driver.get("https://example.com")
# Replace this with a wait for the page state your test needs.
driver.save_screenshot("viewport.png")
finally:
driver.quit()
Use a real target URL and your project’s installed Selenium and Chrome setup. The example demonstrates the capture call, not a guarantee that every page has finished rendering when navigation returns.
Capture one element
If the intended image is a component rather than the whole viewport, capture that WebElement. This can avoid unrelated surrounding content, but it does not fix a page element that is itself part of the component or a locator that resolves in the wrong frame.
Rank #2
from selenium import webdriver
from selenium.webdriver.common.by import By
options = webdriver.ChromeOptions()
driver = webdriver.Chrome(options=options)
try:
driver.get("https://example.com")
component = driver.find_element(By.CSS_SELECTOR, "main")
component.screenshot("component.png")
finally:
driver.quit()
Change main to a selector that identifies the element you actually want. If the element is inside an iframe, switch into that frame before locating it.
Capture a Chrome region or content beyond the viewport
When a Chrome capture needs a defined region or content beyond the visible viewport, the Chrome DevTools Protocol command is Page.captureScreenshot. Its current Page protocol reference documents a clip region and captureBeyondViewport, whose documented default is false. These settings need to match the installed Chrome version and the coordinate system of the page; a wrong origin, width, height, or scale can produce a surprising crop.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errorsFor example, the protocol parameters conceptually include a clip rectangle and an explicit beyond-viewport choice:
{
"clip": {
"x": 0,
"y": 0,
"width": 1280,
"height": 1600,
"scale": 1
},
"captureBeyondViewport": true
}
This is a parameter illustration, not a drop-in WebDriver call: how to send CDP commands depends on the Selenium binding and supported browser/version combination. Check the matching Selenium and Chrome interfaces before wiring it into a test. Do not assume a Chrome-specific protocol option applies to other browsers.
Rank #3
Fixes by cause
The strip is an HTML element
If the DOM contains the strip, inspect its CSS and page state. A fixed header can legitimately stay at the top of the viewport while the page scrolls; sticky behavior can make its position depend on scroll. If the element should not be visible in the test state, correct the page or test setup. Use an element screenshot or an intentional crop only when that matches the expected deliverable; cropping can conceal a real application-state problem.
The content belongs to an iframe
Inspect the frame boundary and switch into the correct frame before locating or capturing its contents. Selenium’s frame interaction guide explains frame switching. A locator run against the top-level document will not inspect a nested frame as though it were ordinary top-level content.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
The wrong tab or window is active
Enumerate or track the available window handles, switch to the handle for the page under test, and only then capture. This is particularly important when a test opens a new tab or window. Confirm the expected URL and page state after switching rather than relying on which window happens to be focused on the desktop.
The screenshot has the wrong extent or crop
Decide whether you need the viewport, an element, or beyond-viewport content. For Chrome protocol capture, supply a deliberate clip and set captureBeyondViewport explicitly when its default behavior is not what you need. Verify that the clip’s coordinates and dimensions correspond to the intended page geometry. A crop can remove unwanted material from an image, but it cannot establish whether that material was native UI or page content.
The strip appears to be native browser UI
Page DOM locators cannot remove native window chrome because it is not a page element. Use a capture path intended for page content or adjust the browser/runtime setup, then inspect the output. Do not infer from the phrase “driver screenshot” alone that native browser UI is always included or always excluded; behavior should be verified for the actual platform and run mode.
Rank #4
Troubleshooting common symptoms
| Symptom | Likely area to check | Next step |
|---|---|---|
| Strip matches text or layout in the page | DOM, CSS, scroll position, or iframe | Inspect the element and frame context; correct page/test state or capture the intended element. |
| Screenshot shows a different page than expected | Active window or tab | Switch to the intended handle; verify the URL and page state before capture. |
| Only part of a long page appears | Viewport capture versus beyond-viewport capture | Use an appropriate Chrome protocol capture and explicitly define clip and beyond-viewport behavior. |
| Crop is shifted or unexpectedly sized | Clip coordinates, dimensions, or scale | Compare the coordinate values with the intended page geometry and runtime dimensions. |
| Result differs between local and CI | Browser/driver versions, headed/headless mode, dimensions, or timing | Record and align the runtime; wait for the page state required by the test. |
| Cannot locate a visible item | Wrong document or frame context | Check whether the item is inside an iframe and switch context before locating it. |
A useful minimal reproduction records browser and driver builds, Selenium binding and version, headed/headless configuration, exact screenshot method and call, window/viewport dimensions, scroll position, and whether the strip appears in the live page DOM. Those details narrow the issue without assuming a universal Selenium defect.
Performance, reliability, and output choices
A viewport or element capture targets less content than a full-page-style capture, so choose the smallest extent that serves the test. Beyond-viewport capture and large image dimensions can produce larger outputs and may require the page to have laid out the relevant content first. The official API references describe the capture controls, not a universal performance cost; measure in the browser and CI environment you use.
For repeatable screenshots, keep browser/driver versions and viewport settings stable, wait for the specific UI state that matters, and use a consistent target (window, element, or clip). If a page contains dynamic ads, timestamps, or asynchronous widgets, stabilize or account for those separately rather than treating every visual difference as a title-bar issue.
Or skip the browser setup
If the goal is simply a clean website image or PDF, ScreenshotNeo is a website screenshot API and MCP server from Yorker Media. One GET request returns a PNG, JPEG, WebP, or PDF; its capture options include full-page screenshots, element selection, custom viewport and device presets, and PDF controls. Cookie banners are accepted and removed alongside 60+ known consent platforms, newsletter popups, and chat widgets before the shot; each step can be disabled. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, with response headers indicating the page verdict and billing status. An MCP server exposes take_screenshot, get_page_info, and capture_pdf to AI agents and MCP clients.
Install the Python dependency with pip install requests, set an API key, and run:
Best Value
import requests
r = requests.get(
"https://api.screenshotneo.com/v1/shot",
params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
timeout=90,
)
open("shot.webp", "wb").write(r.content)
See the ScreenshotNeo API documentation for request options and response details. The service offers 1,000 screenshots per month free with no card; paid plans start at $5 for 3,000, and every feature is on every plan. Sign up for 1,000 free screenshots a month, with no card required.
Frequently Asked Questions
Does a Selenium screenshot always include the browser’s native title bar?
The cited Selenium API describes driver screenshots as captures of the current window, but that does not establish uniform native-UI behavior across operating systems and execution modes. Verify the result in your runtime.
What details should I include when asking for help with a mid-page strip?
Provide a minimal reproducible example plus browser and driver versions, Selenium binding/version, headed or headless mode, screenshot call, window and viewport dimensions, scroll position, and whether the strip appears in the page DOM.
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.

