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

To screenshot a right-to-left (RTL) page with Playwright, make sure the page sets its base direction with dir="rtl", wait for the page content and fonts to be ready, then capture the viewport, full page, or a specific element. Playwright’s locale emulation does not set the document’s text direction.

Set the page’s direction before capturing

For a page predominantly written in Arabic, Hebrew, or another RTL script, set dir="rtl" on the document root, usually <html lang="ar" dir="rtl">. The lang attribute identifies the language but does not establish the base direction. Direction affects more than text alignment: it also influences the order of mixed-direction text and the placement of neutral punctuation. See MDN’s reference for the HTML dir attribute.

For inline English text inside an RTL paragraph, mark that span explicitly, for example <span lang="en" dir="ltr">Playwright</span>. When the content is unknown user-provided text, dir="auto" can choose a base direction from the first strongly directional character. It is a heuristic, not language detection. Prefer the semantic HTML dir attribute over CSS direction where possible.

If you do not control the target page, it must already declare the correct direction or you must deliberately modify the page before capture. Do not assume that setting Playwright’s locale will fix an incorrectly directed document.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents

Capture an RTL page with Playwright

Install Playwright and its browser if you have not already done so. The following JavaScript example uses Chromium, navigates to a page, waits for network activity to settle and for document fonts to resolve, then saves a full-page PNG:

import { chromium } from 'playwright';

const browser = await chromium.launch();
const page = await browser.newPage();

try {
  await page.goto('https://example.com', { waitUntil: 'networkidle' });
  await page.evaluate(() => document.fonts.ready);
  await page.screenshot({ path: 'page.png', fullPage: true });
} finally {
  await browser.close();
}

Replace https://example.com with the page to capture. The site itself needs to render its content in the intended direction; the script above waits and captures, but does not repair page markup. Playwright’s screenshot guide covers capture basics. Consult the Page API for options supported by your installed Playwright version, since API defaults can vary by version.

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors

Choose the capture scope

  • Current viewport: await page.screenshot({ path: 'viewport.png' });
  • Whole scrollable page: await page.screenshot({ path: 'full.png', fullPage: true });
  • One element: await page.locator('main').screenshot({ path: 'main.png' });
  • Image in memory: const buffer = await page.screenshot(); The call returns a buffer, useful when another part of your program will process or store the image.

The default screenshot type is PNG; a path extension can select a format. Use fullPage: true when the entire scrollable document is needed, and omit it for a viewport capture.

Wait for fonts and application content

await page.evaluate(() => document.fonts.ready) waits for the document’s font set to resolve and layout to complete. This matters for Arabic and Hebrew glyph rendering and can prevent a capture from using a temporary fallback font. It does not wait for application-specific asynchronous data or guarantee that images have finished loading. Use a readiness signal tied to the page when content is populated after navigation—for example, wait for a known element with page.locator(...).waitFor() before taking the screenshot. The CSS Font Loading API reference describes font readiness.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.

waitUntil: 'networkidle' is an example, not a universal readiness rule. Applications with ongoing network activity may never become idle. For those pages, choose a more suitable navigation condition and wait for a page-specific signal rather than relying on network idleness alone.

Keep locale and text direction separate

Playwright locale emulation can affect locale-sensitive browser behavior, but it does not assign dir="rtl" to the page’s HTML. A page can therefore run with an Arabic locale and still have the wrong base direction if its markup or deliberate pre-capture changes do not set direction. Conversely, a page with correct RTL markup can be captured without changing locale if locale-specific behavior is not part of the test. See Playwright’s emulation documentation.

Rank #4
Sale
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient

Check the screenshot for RTL-specific problems

When correctness matters, inspect the actual image rather than assuming that a successful screenshot call means the layout is right. Check Arabic or Hebrew glyph shaping, mixed-script words and punctuation, font fallback, and clipping at the chosen viewport. If the page is cut off, decide whether you need a full-page capture or a different viewport; if the text looks wrong, inspect the page’s direction and font readiness before changing screenshot options.

For visual regression tests

In Playwright Test, expect(page).toHaveScreenshot() is a screenshot assertion. It waits for two consecutive captures to match before comparing against the expected image. Rendering can differ across host operating systems, browser versions, settings, hardware, power conditions, and headless mode. Keep the environment used to create and compare baselines controlled, and review the visual comparisons guide and PageAssertions API.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common capture problems

  • Text is left-to-right or punctuation appears misplaced: verify the target document’s root has the intended dir value. A language declaration or Playwright locale setting alone does not assign base direction.
  • English fragments behave oddly inside RTL text: mark the fragment with dir="ltr" where appropriate; use dir="auto" for unknown text only when its first strongly directional character is a reasonable heuristic.
  • Arabic or Hebrew characters look different in the image: wait for document.fonts.ready and inspect whether the intended web font actually loaded. Font readiness alone does not wait for app data or images.
  • Navigation hangs while waiting for network idle: the page may keep network requests active. Use a different navigation wait condition and wait for a meaningful application-ready selector or signal.
  • Content is missing from the bottom of the image: use fullPage: true for the whole scrollable document; a default screenshot covers the current viewport.
  • Screenshots differ between machines: run comparisons with consistent browser and host settings, since rendering may vary by operating system, browser version, hardware, and headless configuration.

Or skip the browser setup

ScreenshotNeo is a screenshot API and MCP server for developers. A single request can return an image or PDF; it is an option when you want an API capture rather than maintaining a Playwright browser workflow. Its clean-shot process accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status in headers. AI agents can use its MCP server tools, including take_screenshot, get_page_info, and capture_pdf. The free plan includes 1,000 shots per month without a card; paid plans start at $5 for 3,000 shots. See the ScreenshotNeo API documentation.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

Sign up for 1,000 free screenshots a month, with no card required.

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.