Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

With Ruby, the most direct documented way to capture an entire web page is Ferrum: open a Chromium page, navigate to the URL, and call page.screenshot(path: "full-page.png", full: true). The full: true option makes Ferrum measure the document and capture beyond the visible viewport. This guide shows a complete script, output formats, Capybara and Selenium alternatives, troubleshooting, and a browser-free API option.

Fastest working example with Ferrum

Install Ferrum in your Ruby project, make sure Chrome or Chromium is available, then run this script:

require "ferrum"

browser = Ferrum::Browser.new
page = browser.create_page

begin
  page.go_to("https://example.com")
  page.screenshot(path: "full-page.png", full: true)
ensure
  browser.quit
end

The resulting full-page.png includes the page’s full document dimensions rather than only the current viewport. The ensure block closes Chromium even when navigation or capture raises an exception.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

In a Gemfile, add gem "ferrum", run bundle install, and execute the file with Bundler (for example, bundle exec ruby screenshot.rb). Ferrum’s project documentation contains the current browser-installation and executable-path instructions: github.com/rubycdp/ferrum.

#1 Best Overall
Sale
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • Auto-Light Balance: RightLight boosts brightness by up to 50%, reducing shadows so you look your best—compared to previous-generation Logitech webcams (1)
  • Privacy with a Slide: The integrated webcam cover makes it easy to get total, reliable privacy when you're not on a video call
  • Built-In Mic: The built-in microphone lets others hear you clearly during video calls
  • Easy Plug-And-Play: The Brio 101 works with most video calling platforms, including Microsoft Teams, Zoom and Google Meet—no hassle; it just works

What full: true does

Ferrum’s screenshot implementation obtains the document’s width and height, builds a full-window capture area, and enables Chrome’s capture-beyond-viewport behavior. Consequently, content below the fold is included without manually scrolling and stitching images.

full: true takes precedence over selector and area options. If you pass a CSS selector or a custom rectangle at the same time, Ferrum warns that those crop settings are ignored. Use one of the following patterns instead:

Capture the whole document

page.screenshot(path: "page.webp", full: true, format: :webp)

Capture a specific element

page.screenshot(path: "article.png", selector: "main article")

Capture a rectangle

page.screenshot(
  path: "region.jpg",
  area: { x: 0, y: 0, width: 1200, height: 900 },
  format: :jpeg
)

Do not combine the latter two forms with full: true when you need the crop to take effect.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Formats, files, and Base64 output

PNG is Ferrum’s default screenshot format. The documented formats include PNG, JPEG/JPG, and WebP. Choose a path to write bytes directly to disk, or request Base64 when another service will receive the image:

require "ferrum"

browser = Ferrum::Browser.new
page = browser.create_page

begin
  page.go_to("https://example.com")
  encoded = page.screenshot(full: true, encoding: :base64)
  File.write("full-page.base64.txt", encoded)
ensure
  browser.quit
end

Use an image extension that matches the selected format. JPEG is usually smaller for photographic pages but does not preserve transparency; PNG is lossless; WebP can reduce size when your downstream tools support it. Exact byte size depends on the page and encoding settings.

Rank #2
Sale
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • Crisp HD 720p/30 fps video calls with diagonal 55° field of view and auto light correction. Compatible with popular platforms including Skype and Zoom.
  • The built-in noise-reducing mic makes sure your voice comes across clearly up to 1.5 meters away, even if you’re in busy surroundings.
  • C270’s RightLight 2 feature adjusts to lighting conditions, producing brighter, contrasted images to help you look good in all your conference calls.
  • The adjustable universal clip lets you attach the camera securely to your screen or laptop, or fold the clip and set the webcam on a shelf. You’re always ready for your next video call.

Make the capture reliable

A screenshot taken immediately after navigation can miss late-loading fonts, images, or client-rendered content. Add explicit waits based on the application rather than an arbitrary long sleep.

Wait for a page element

page.go_to("https://example.com/dashboard")
page.at_css("main.dashboard")
page.screenshot(path: "dashboard.png", full: true)

at_css waits for the selector according to Ferrum’s timeout configuration and raises if it never appears. For a known animation or delayed API response, a short, documented delay can be used, but selector-based readiness is generally less fragile.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Set a predictable viewport

browser = Ferrum::Browser.new(
  window_size: [1440, 900]
)
page = browser.create_page

The viewport affects responsive breakpoints and therefore the layout that is expanded into the full-page image. Keep it fixed in CI so screenshots are comparable. If the site changes content by locale or time zone, configure those browser properties in the Ferrum version you use and record them with the artifact.

Lazy-loaded content

Some sites load images only after they approach the viewport. A full capture asks Chrome to capture the document, but application code may still defer network requests. Wait for the relevant images or trigger the site’s own “load more” behavior before calling screenshot. Verify that image elements have completed loading when visual completeness matters.

Using Ferrum from Capybara with Cuprite

Cuprite is a Capybara driver built on Ferrum. It is useful when your tests already use Capybara sessions and matchers. Register the driver using Cuprite’s current documentation, then access the underlying Ferrum capabilities through the driver version installed in your project.

Rank #3
Sale
NexiGo N60 1080P Webcam with Microphone, Software Control & Privacy Cover, USB HD Computer Web Camera, Plug and Play, for Zoom/Skype/Teams, Conferencing and Video Calling
  • 【Full HD 1080P Webcam】Powered by a 1080p FHD two-MP CMOS, the NexiGo N60 Webcam produces exceptionally sharp and clear videos at resolutions up to 1920 x 1080 with 30fps. The 3.6mm glass lens provides a crisp image at fixed distances and is optimized between 19.6 inches to 13 feet, making it ideal for almost any indoor use.
  • 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 8, 10 & 11 / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.
  • 【Built-in Noise-Cancelling Microphone】The built-in noise-canceling microphone reduces ambient noise to enhance the sound quality of your video. Great for Zoom / Facetime / Video Calling / OBS / Twitch / Facebook / YouTube / Conferencing / Gaming / Streaming / Recording / Online School.
  • 【USB Webcam with Privacy Protection Cover】The privacy cover blocks the lens when the webcam is not in use. It's perfect to help provide security and peace of mind to anyone, from individuals to large companies. 【Note:】Please contact our support for firmware update if you have noticed any audio delays.
  • 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 10 & 11, Pro / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.

A typical Capybara test can navigate normally:

require "capybara/rspec"
require "cuprite"

Capybara.register_driver(:cuprite) do |app|
  Capybara::Cuprite::Driver.new(app, headless: true)
end

Capybara.current_driver = :cuprite

visit "https://example.com"
page.save_screenshot("capybara-page.png", full: true)

Driver method names and access to the native Ferrum page can vary by Cuprite release. If full: true is not accepted by your installed driver, consult the matching Cuprite documentation and use its native-page interface. Do not assume a snippet written for another version is interchangeable.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Selenium’s Ruby full-page option

Selenium’s Ruby screenshot module documents a full_page argument: Selenium WebDriver TakesScreenshot. A minimal example is:

require "selenium-webdriver"

driver = Selenium::WebDriver.for :chrome
begin
  driver.navigate.to "https://example.com"
  driver.save_screenshot("full-page.png", full_page: true)
ensure
  driver.quit
end

Check compatibility with the Selenium gem, browser, and driver versions in your project before relying on this option in CI. Full-page behavior can depend on the browser implementation; if the result is viewport-sized, verify versions and consult the API documentation for your stack.

Choosing a Ruby route

Route Full-page request Best fit Important setup
Ferrum full: true Direct Ruby control over headless Chrome/Chromium Ferrum gem and an available browser binary
Cuprite Ferrum capabilities through a Capybara driver Capybara applications and system tests Cuprite, Capybara, and version-matched driver access
Selenium Ruby full_page: true Projects already standardized on Selenium Selenium, compatible browser, and WebDriver setup
Playwright Its page API documents full-page capture Only where your project has a supported binding The cited API reference does not establish Ruby bindings

The Playwright page reference documents a full-page feature, but that reference is not evidence of an official Ruby API. Do not paste JavaScript or Python Playwright code into a Ruby application and expect it to work: Playwright Page API.

Troubleshooting checklist

“Browser executable not found”

Cause: Chrome or Chromium is missing, or Ferrum cannot locate it. Fix: install a supported browser in the machine or container and follow Ferrum’s current executable-path guidance. In CI, make the browser installation an explicit build step.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
EMEET C960 1080P Webcam with Microphone, 2 Mics, 90° FOV, Computer Camera
  • 1080P Webcam with Cover for Video Calls - EMEET computer webcam provides design and Optimization for professional video streaming. Realistic 1920 x 1080p video, 5-layer anti-glare lens, providing smooth video. C960 computer camera delivers 1920x1080 video with fixed focus (11.8–118.1 inches), so as to provide a clearer image. C960 USB webcam has a cover and can be removed automatically to meet your needs for privacy. For optimal image performance, use the webcam in a well-lit environment.
  • Built-in 2 Omnidirectional Mics - EMEET webcam with microphone for desktop features 2 built-in omnidirectional microphones, picking up your voice to create clear audio for communication. When installing the webcam, select EMEET C960 as the default microphone input device in your computer and video applications and select C960 as the default device in Zoom/Teams and ensure microphone permissions are enabled for proper use. Please note that C960 does not include built-in speakers.
  • Automatic Light Adjustment - Automatic exposure adjustment is applied in EMEET HD webcam 1080p so that the streaming webcam can deliver stable image performance. EMEET C960 camera for computer also features color adjustment and exposure optimization to help you look your best. For optimal video quality, it is recommended to use the webcam in normal or well-lit environments and select suitable video settings in your application. Proper lighting helps achieve a clearer and more balanced image.
  • Plug-and-Play & Upgraded USB Connectivity - New C960 webcam features both USB Type-A & A-to-C adapter connections for wider compatibility. For stable performance, connect the webcam directly to the computer's main USB port and ensure the device is recognized correctly. If a hub or docking station is used, please ensure it provides sufficient power and stable data transmission, as limited ports may affect performance. 90° wide-angle lens captures more participants without frequent adjustments.
  • High Compatibility & Multi Application - C960 webcam for laptop is compatible with Windows 10/11, macOS 10.14+, and Android TV 7.0+. Not supported: Windows Hello, TVs, tablets, or game consoles. It works with Zoom, Teams, Facetime, Google Meet, YouTube and more. Please select C960 webcam as the default camera and microphone device in your application and ensure camera/microphone permissions are enabled, especially on macOS. (Tips: Incompatible with Windows Hello)

The image is only the viewport

Cause: full: true was omitted, ignored by a wrapper, or the Selenium/browser combination does not implement the option as expected. Fix: call Ferrum’s native screenshot method with full: true; for Selenium, confirm the installed versions and the full_page implementation.

Images or text are missing

Cause: the application is still rendering, lazy loading, or waiting on an API. Fix: wait for a stable selector, ensure the relevant requests complete, and capture after the application reaches its ready state.

Cookie banners, chat bubbles, or sticky headers obscure content

Cause: those elements are part of the page at capture time. Fix: in a browser script, dismiss the banner or hide known selectors before capture. For repeatable output, make that cleanup part of your test fixture.

The process hangs or leaves Chrome running

Cause: an exception bypassed cleanup. Fix: wrap navigation and capture in begin/ensure and always call browser.quit or driver.quit. Also set practical timeouts for navigation and waiting.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Captures differ between local and CI

Cause: viewport size, fonts, device scale, locale, time zone, network responses, or browser versions differ. Fix: pin the browser environment where possible, set a fixed window size, wait for deterministic readiness, and store the exact URL and capture settings alongside each artifact.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Performance, storage, and repeatability

  • Full pages can be much taller than the viewport, increasing memory use and PNG size. Capture only the required selector when a full document is unnecessary.
  • JPEG or WebP may reduce storage, while PNG is the safer choice for pixel-accurate diffs and text-heavy pages.
  • Reuse a browser process for multiple URLs when appropriate, but create a fresh page or clear state between captures to prevent cookies and application data leaking across tests.
  • For visual regression, keep viewport, browser version, fonts, URL parameters, authentication state, and readiness conditions fixed.
  • Protect authenticated screenshots: they may contain personal or confidential data, and files should be stored with the same access controls as application logs.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. One GET request returns a PNG, JPEG, WebP, or PDF, so Ruby does not need to install or manage Chrome. It removes cookie/consent banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools to Claude, Cursor, and other MCP clients.

Use the API from Ruby:

require "requests"

r = requests.get(
  "https://api.screenshotneo.com/v1/shot",
  params: { access_key: "YOUR_API_KEY", url: "https://stripe.com" },
  timeout: 90
)
File.write("shot.webp", r.content)

In standard Ruby, use an HTTP client such as Net::HTTP or your project’s existing request library; the equivalent request shape is documented at ScreenshotNeo’s documentation. The supplied cross-language examples are:

Best Value
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • HD lighting adjustment and autofocus: The Logitech webcam automatically fine-tunes the lighting, producing bright, razor-sharp images even in low-light settings. This makes it a great webcam for streaming and an ideal web camera for laptop use
  • Advanced capture software: Easily create and share video content with this Logitech camera that is suitable for use as a desktop computer camera or a monitor webcam
  • Stereo audio with dual mics: Capture natural sound during calls and recorded videos with this 1080p webcam, great as a video conference camera or a computer webcam
  • Full HD 1080p video calling and recording at 30 fps. You'll make a strong impression with this PC webcam that features crisp, clearly detailed, and vibrantly colored video
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
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)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

ScreenshotNeo also supports full-page capture with lazy images loaded, CSS-selector element capture, device presets and custom viewports, retina scale, PDF paper and page-range controls, custom CSS and JavaScript, clicks, selector or network-idle waits, request blocking, headers, cookies, user agents, authorization, time zone and geolocation, transparent backgrounds, resizing, selectable-TTL caching, signed image links, asynchronous webhooks, bulk capture for up to 100 URLs per call, a usage API, and an OpenAPI specification. Parameter names used by other screenshot APIs also work, which can simplify migration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Plan Included shots Price
Free 1,000 per month $0, no card
Starter 3,000 $5
Growth 15,000 $15
Pro 60,000 $39
Scale 250,000 $99
Business 1,000,000 $249

Yearly billing provides two months free, and every feature is included on every plan. Create a free ScreenshotNeo account to get 1,000 screenshots each month without a card.

Frequently Asked Questions

Does Ferrum need a visible desktop session?

No. Ferrum is designed to drive Chrome or Chromium programmatically, commonly in headless mode; the browser binary still has to be installed and discoverable.

Can I capture a full page and a CSS selector in one Ferrum call?

No. Ferrum documents that full: true takes precedence and selector or area options are ignored. Capture the document or the crop as separate operations.

Is a full-page screenshot the same as a PDF?

No. A screenshot is a raster image such as PNG, JPEG, or WebP. A PDF has page dimensions, pagination, margins, and print-layout behavior.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What should I archive with a screenshot for a visual test?

Store the URL, viewport, browser and driver versions, relevant authentication or fixture identifier, readiness condition, and capture timestamp so a difference can be reproduced.

Quick Recap

SaleBestseller No. 1
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
Compatible with Nintendo Switch 2’s new GameChat mode; Built-In Mic: The built-in microphone lets others hear you clearly during video calls
$35.90
SaleBestseller No. 2
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
Compatible with Nintendo Switch 2’s new GameChat mode
$16.89
Bestseller No. 5
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
Compatible with Nintendo Switch 2’s new GameChat mode; Fully compatible with Windows 11
$69.99

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.