Free tools Windows power users keep installed

One-click scans. No signup required.

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

Use Ruby to drive a headless Chromium browser with the playwright-ruby-client gem. Install a Playwright driver, a matching browser binary, and Linux dependencies; then navigate to the page and call page.screenshot. The browser can run on the same Unix host or on a separate Playwright server when local process execution is restricted.

What you need before writing Ruby code

  • A supported Ruby application with Bundler.
  • The playwright-ruby-client gem.
  • A Playwright CLI/driver version compatible with that Ruby client.
  • A Chromium (or another supported browser) binary installed by Playwright.
  • Linux shared libraries required by the browser.
  • A writable directory for the resulting image.

The Ruby client does not bundle Playwright or its browser. Its official repository documents configuring the Playwright executable path, while Playwright’s browser guide covers browser downloads, release matching, and Linux dependency installation. Treat the Playwright release and browser build as a pair: after upgrading the client or CLI, verify that the browser is still the corresponding build and reinstall it when necessary.

Install the Ruby client and Playwright

Add the gem

Add the client to your application’s Gemfile and install it:

gem "playwright-ruby-client"
bundle install

Install Playwright using the method supported by the client version you selected. Keep the executable in a known location; the example below expects ./node_modules/.bin/playwright. If your deployment places it elsewhere, change that path rather than relying on a shell-specific PATH.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • 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.

Install a browser and Linux dependencies

Use Playwright’s installation tooling to download Chromium and, on Linux, the required system packages. The exact command can vary with the Playwright release; consult the browser installation documentation for that release. Run the dependency installation in the same image or host that will launch the browser. A browser copied without its shared libraries commonly fails before Ruby reaches page.screenshot.

Minimal Ruby screenshot script

This is the smallest complete flow: create the client, launch Chromium, open a page, navigate, save a PNG, and close resources. The repository’s illustrative example uses headless: false; a Unix server normally has no display, so the server version below explicitly uses headless mode.

require "playwright"

Playwright.create(
  playwright_cli_executable_path: "./node_modules/.bin/playwright"
) do |playwright|
  playwright.chromium.launch(headless: true) do |browser|
    page = browser.new_page
    page.goto("https://example.com")
    page.screenshot(path: "capture.png")
  end
end

Run it with Bundler so the deployed gem versions are used:

bundle exec ruby screenshot.rb

The file capture.png is a viewport screenshot of the page state reached by goto. Use an absolute output path in a worker or container when the process’s working directory is not predictable.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

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

Make the capture reliable

Wait for the page’s real ready state

Navigation completing does not guarantee that an application has finished rendering data, fonts, or images. Wait for a meaningful application-specific selector or state before capturing. For example, wait for the report panel that your page renders, not an arbitrary sleep:

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 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.
page.goto("https://example.com/dashboard")
page.locator("[data-testid='report-ready']").wait_for
page.screenshot(path: "dashboard.png")

The available wait and locator methods depend on the client version; verify their exact names in the installed API. A fixed delay can be useful for a known animation, but it is not a universal readiness strategy.

Choose viewport or full-page output

Playwright’s Page API documents screenshot controls. The default captures the current viewport. Set a viewport deliberately when layout matters, or request a full-page image when the entire scrollable document is required:

page = browser.new_page(viewport: { "width" => 1440, "height" => 900 })
page.goto("https://example.com/article")
page.screenshot(path: "article-full.png", full_page: true)

Full-page captures can become extremely tall. They may consume more memory and create files that are inconvenient for downstream systems.

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

Control format, quality, and scale

  • PNG: lossless and the default choice for pixel-accurate work.
  • JPEG: smaller for photographic content; use the documented quality option because it is lossy.
  • WebP: a compact alternative when your consumers support it.
  • Scale: choose CSS-pixel or device-pixel output as documented. Device scaling produces sharper, potentially larger files.
page.screenshot(
  path: "hero.jpg",
  type: "jpeg",
  quality: 85
)

For one component instead of the whole page, use the locator screenshot API:

page.locator("header.site-header").screenshot(path: "header.png")

Confirm option spelling and availability against the API version installed in your bundle; Playwright’s API reference is version-sensitive.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • 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.

Headless operation on Unix

A headed launch such as headless: false requires a graphical display (or a configured virtual display). On a normal SSH-only Linux server, use headless: true. If a policy requires headed mode, provide the display infrastructure separately and ensure the browser can access it; do not assume a desktop session exists.

Run the browser under the same user and filesystem permissions as the Ruby worker. Give that user permission to write the destination directory, and clean up abandoned browser processes if a job is terminated. Set navigation and operation timeouts appropriate to your workload rather than allowing a stuck page to occupy a worker indefinitely.

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

When the browser cannot run on the Ruby host

The Ruby client project documents connecting to a separately running Playwright server. This arrangement is useful when the application host cannot install Linux libraries, is not allowed to create browser processes, or must isolate browser traffic on a dedicated machine or container.

Deployment choice Advantages Costs and checks
Local browser One process boundary and a simpler request path when the host supports Playwright. You own browser binaries, OS libraries, sandbox policy, upgrades, and concurrency.
Separate Playwright server Centralizes browser installation and can isolate execution from the Ruby application. Requires network connectivity, authentication and an explicit security boundary between the worker and browser host.

Whichever model you choose, pin compatible versions, monitor browser-process counts, and treat captured images as potentially sensitive data. Do not store screenshots longer than your use case requires.

Common failures and fixes

“Executable doesn’t exist” or browser launch failure

Cause: the CLI path is wrong, or the browser was never installed for the current Playwright release. Fix: check playwright_cli_executable_path, run the release’s browser-install command, and verify that the Ruby client and browser belong to compatible Playwright versions.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • 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

Missing shared library or sandbox error

Cause: a minimal Linux image lacks browser dependencies or applies restrictive process policies. Fix: install the documented Linux dependencies with Playwright’s tooling, then test as the same service user. Change container security settings only under your platform’s security policy.

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

No display available

Cause: a headed launch is being used on a headless server. Fix: launch with headless: true, or deliberately configure a display environment before using headed mode.

Blank, partial, or stale content

Cause: the screenshot was taken before application data or lazy content became ready. Fix: wait for a selector or state that proves the required content is present, and use full-page capture when the target extends beyond the viewport. Avoid assuming that a single delay works for every page.

Timeouts and hung workers

Cause: a slow origin, blocked third-party resource, or page script that never settles. Fix: set explicit navigation and action timeouts, handle failures per URL, close the page/browser in the documented block structure, and retry only when the failure is transient.

Image cannot be written

Cause: a relative path resolves somewhere unexpected or the service user lacks permission. Fix: create the destination directory during deployment, use an absolute path, and check free disk space.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 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.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

ScreenshotNeo provides a website screenshot API and MCP server. One GET request returns PNG, JPEG, WebP, or PDF. It accepts cookie/consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be disabled. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing result.

Ruby is not required for the request, but you can call the endpoint from any Unix job. The complete API reference is at https://screenshotneo.com/docs/.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
require "net/http"
require "uri"

uri = URI("https://api.screenshotneo.com/v1/shot")
uri.query = URI.encode_www_form(access_key: "YOUR_API_KEY", url: "https://stripe.com")
response = Net::HTTP.get_response(uri)
File.binwrite("shot.webp", response.body)

It also offers full-page and CSS-selector captures, dark mode, device presets and custom viewports, retina scale, PDF controls, custom CSS and JavaScript, pre-capture clicks, selector hiding, selector/delay/network-idle waits, request blocking, headers, cookies, user agents, authorization, timezone and geolocation, transparent backgrounds, resizing, chosen-TTL caching, signed image links, asynchronous jobs with signed webhooks, bulk capture of 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.

An MCP server exposes take_screenshot, get_page_info, and capture_pdf to Claude, Cursor, and other MCP clients. Plans include 1,000 shots per month free with no card; paid plans start at $5 for 3,000 shots, with every feature on every plan. Create a free ScreenshotNeo account to try the API without a card.

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

Ruby capture checklist

  • Pin a compatible Ruby client, Playwright CLI, and browser build.
  • Install Linux browser dependencies in the runtime image.
  • Use headless mode on servers without a display.
  • Wait for the page state your screenshot actually needs.
  • Select viewport, full-page, element, format, quality, and scale intentionally.
  • Use writable absolute paths and close resources with block syntax.
  • Decide whether local execution or a separate Playwright server better fits your security and scaling constraints.

Frequently Asked Questions

Can this run from a cron job?

Yes. Use a non-interactive Ruby script, an absolute output path, headless mode, and explicit timeouts; ensure the cron environment can locate the configured Playwright executable.

Why does the output differ from what I see in my desktop browser?

Viewport dimensions, device scale, fonts, cookies, authentication state, responsive breakpoints, and asynchronous application state can all change pixels. Make those inputs explicit and wait for the required selector before capture.

Is a browser server mandatory?

No. Local Chromium is simplest when the Unix host can install and launch Playwright. A separate Playwright server is an alternative documented by the Ruby client for restricted hosts or centralized browser operations.

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.

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