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

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Use Selenium to navigate to the booking page, wait for the specific fare or results state you need, set a repeatable browser window size, and save either the visible window or a specific element as a PNG. A page-load event alone does not guarantee dynamic fares are ready, and an ordinary window screenshot should not be described as a full-page capture.

Choose what the screenshot needs to prove

Selenium’s standard screenshot methods capture the current browsing context or a particular element. Pick the scope that matches your evidence:

  • Current window: Use this when the relevant page state is visible in the browser window.
  • One element: Use this when the evidence is a specific fare card, results panel, or control. Selenium documents element screenshots as a separate option.

Do not call a current-window image a full-page screenshot. Full-page capture requires a separately verified method; the ordinary APIs discussed here do not establish that the entire scrollable page is captured.

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

Capture a flight-search result with Selenium in Python

Install Selenium and configure a WebDriver supported by your browser. The example below opens a page, waits for a caller-specified results element, fixes the window size, and saves the visible browser window. Replace the URL and CSS selector with the booking page and target state you are authorized to access.

#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
from pathlib import Path
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait

url = "https://example.com/flights"
results_selector = "[data-testid='flight-results']"
output = Path("flight-results.png")

options = webdriver.ChromeOptions()
# Add any project-specific browser options here.

driver = webdriver.Chrome(options=options)
try:
    driver.set_window_size(1440, 1000)
    driver.get(url)

    # get() waits for the page-load event, but dynamic results can render later.
    WebDriverWait(driver, 30).until(
        lambda d: d.find_element("css selector", results_selector).is_displayed()
    )

    saved = driver.get_screenshot_as_file(str(output))
    if not saved:
        raise OSError(f"Could not write screenshot to {output}")
    print(f"Saved {output.resolve()}")
finally:
    driver.quit()

The selector is intentionally an example, not a claim about any named Indian airline or travel site. Inspect the page’s actual markup and wait for the element that represents the state you need, such as loaded fares rather than an empty results container.

Capture only a fare card or other element

When the element itself is the evidence, locate it after the relevant state has loaded and call its screenshot method:

fare = driver.find_element("css selector", ".fare-card")
if not fare.is_displayed():
    raise RuntimeError("Fare card is not visible")
fare.screenshot("selected-fare.png")

Use a selector appropriate to the site and confirm that the captured element contains enough context for the screenshot’s intended use.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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

Alternative current-window method

Selenium’s Python API also provides save_screenshot, whose official example saves a PNG with driver.save_screenshot('./image.png'). For example:

if not driver.save_screenshot("flight-results.png"):
    raise OSError("Screenshot could not be saved")

The API’s get_screenshot_as_file(filename) returns a Boolean; it returns false on an I/O error. Check the result and verify the file exists before treating the capture as complete.

Make captures repeatable and useful

Control the window dimensions

Set and record the browser window size before capture. Selenium notes that screen resolution can affect how an application renders, and WebDriver provides ways to move and resize the browser window. A consistent browser, driver, and window size make comparisons more meaningful; they do not guarantee that a site’s content is identical across runs.

Rank #3
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.

Wait for the intended state, not just page load

Selenium’s Python get() waits for the page-load event. Flight results, fare prices, and other booking widgets may still load dynamically afterward. Wait for a condition tied to the actual evidence: for example, a fare card becoming visible or a loading indicator disappearing. If the page can show an empty or partial results panel, visibility alone may not establish that the fares are complete; use a site-appropriate condition.

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

Use clear filenames and inspect the output

Name files so the route, date, or test case can be identified without putting sensitive booking data in the filename. After saving, open the image and check for clipping, overlays, consent dialogs, and unintended personal information.

Protect booking and personal information

Flight-booking screenshots can expose passenger names, contact details, booking references, itinerary information, or access information. Keep those details out of images intended for public sharing, and review every capture before publishing or attaching it to a report.

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 particular booking website’s current terms and obtain permission where necessary before copying or distributing its content. Air India’s website terms address booking and privacy separately, restrict copying or distributing website intellectual property without prior written permission, and place responsibility on users to protect access information and booking data. These terms are specific to Air India; check the applicable site’s terms rather than assuming they apply identically across Indian booking websites.

Document interface choices without changing them

For interface documentation, preserve the visible state and context of a choice. Do not alter a page and then present the image as evidence of the unmodified interface. A Ministry of Consumer Affairs release dated 17 July 2026 reported a ₹1 lakh penalty imposed by the Central Consumer Protection Authority on SpiceJet over pre-ticked loyalty-program enrollment and promotional-message choices on its flight-booking platform. The release said consent should be explicit, informed, and freely given, and stated that consent obtained through pre-ticked checkboxes, default settings, or deceptive interface design is not valid under the cited consumer rules. This was a specific enforcement action, not a general statistic about booking sites.

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

Troubleshoot common capture failures

Symptom Likely cause What to do
Screenshot is missing or the save method returns false The output path is unwritable, invalid, or points to a missing directory. Use a writable path, create its parent directory if needed, check the Boolean result from get_screenshot_as_file, and confirm the file exists.
Image shows a loader or no fares The page-load event completed before dynamic booking content was ready. Wait for a condition tied to the target fare or results state; increase the timeout only if the page legitimately needs longer.
Target element cannot be found The example selector does not match the site, the element has not appeared, or the page state differs. Inspect the rendered page and use a selector for the actual element. Wait for presence or visibility as appropriate.
Capture differs between runs Window dimensions, browser/driver environment, or page state may differ. Set and record the window size; keep the browser and driver environment consistent; wait for the same target state.
Image cuts off content below the viewport The standard current-window screenshot captures the visible browsing context, not necessarily the entire scrollable page. Capture the relevant element or use a separately verified full-page technique. Do not label the ordinary window capture as full-page.
Screenshot includes private booking data or obstructing overlays The page displays personal details, consent dialogs, or other overlays in the captured state. Inspect the image, protect or exclude sensitive information as appropriate, and preserve the page state accurately when documenting interface choices.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

For a one-request capture, ScreenshotNeo accepts a URL and returns an image or PDF. Its cleanup steps accept cookie and consent banners like a visitor and remove 60+ known consent platforms, newsletter popups, and chat widgets; each step 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. An MCP server provides take_screenshot, get_page_info, and capture_pdf for AI agents and other MCP clients.

See the ScreenshotNeo documentation for the API parameters. Example cURL request (replace the URL with the page you are permitted to capture):

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.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com/flights -o shot.webp

ScreenshotNeo includes 1,000 screenshots per month free with no card; paid plans start at $5 for 3,000. Sign up for the free plan.

Frequently Asked Questions

Does Selenium’s ordinary screenshot method capture a whole booking page?

It captures the current browsing context or a selected element. Treat full-page capture as a separate method that must be verified for your browser and setup.

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

Why does my Selenium screenshot show results still loading?

The page-load event can finish before dynamic fare results render. Wait for a condition tied to the specific results or price panel you need.

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.