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

To capture an authenticated page, complete the site’s ordinary OTP challenge in a Selenium-controlled browser, wait for a page-specific sign that the protected content is ready, then call driver.save_screenshot("authenticated-page.png"). Keep the login and screenshot in the same WebDriver session. Selenium does not bypass OTP, and the exact fields, redirects, and allowed automation depend on the website.

Capture an authenticated page with Selenium

This Python example shows where to place the screenshot call. It is a template: replace the example URL and the heading selector with values for a site and page you are authorized to access. Complete the site’s legitimate OTP process yourself or through its authorized flow; the script does not automate, bypass, or retrieve an OTP.

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

options = webdriver.ChromeOptions()
options.add_argument("--window-size=1440,1000")
driver = webdriver.Chrome(options=options)

try:
    driver.get("https://authorized.example/")

    # Complete the site's legitimate login and OTP flow here.
    # Continue once the authenticated destination is open in this driver.

    WebDriverWait(driver, 20).until(
        EC.visibility_of_element_located((By.CSS_SELECTOR, "main h1"))
    )
    driver.save_screenshot("authenticated-page.png")
finally:
    driver.quit()

The example uses Selenium Manager through webdriver.Chrome() as shown in current Selenium usage; browser and driver availability still depend on your environment. The --window-size argument sets the browser viewport dimensions. See Selenium’s browser options documentation for driver options.

Wait for the protected content, not just navigation

A page load completing is not proof that a JavaScript application has finished rendering the content you need. Selenium notes that dynamic content can change or appear after the document’s ready state reaches complete. Use an explicit wait for a meaningful condition on the destination page, such as its heading becoming visible or a loading indicator disappearing. The correct selector and condition are site-specific.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Samsung Galaxy A16 4G LTE (128GB + 4GB) International Model SM-A165F/DS Factory Unlocked, 6.7", Dual SIM, 50MP Triple Camera (Case Bundle), Black
  • Please note, this device does not support E-SIM; This 4G model is compatible with all GSM networks worldwide outside of the U.S. In the US, ONLY compatible with T-Mobile and their MVNO's (Metro and Standup). It will NOT work with other CDMA carriers, and it is also not compatible with their MVNO (Visible, Xfinity Mobile, US Mobile, Cricket Wireless, etc).
  • Compatibility with certain third-party devices and accessibility accessories, including some hearing aids, may vary depending on manufacturer support, Bluetooth protocols, software compatibility, and regional firmware limitations. For additional hearing aid compatibility information, please refer to Samsung’s official support documentation.
  • Camera: 50 MP, f/1.8, (wide), 1/2.76", 0.64µm, AF | 50 MP, f/1.8, (wide), 1/2.76", 0.64µm, AF | 2 MP, f/2.4, (macro). Battery: 5000 mAh, non-removable | A power adapter is NOT included.

In the example, WebDriverWait waits up to 20 seconds for main h1 to become visible. Change both the timeout and selector to suit the page. If the condition is not met before the timeout, Selenium raises a timeout exception and the screenshot line is not reached.

A fixed sleep may happen to work, but it waits the same duration regardless of how quickly the page is ready. Selenium also warns against mixing implicit and explicit waits because the combined timing can be unpredictable. Choose an explicit condition that reflects the page state you actually need; see Selenium’s waiting strategies.

Rank #2
Sale
Samsung Galaxy A17 5G Smart Phone 128GB US 1 Yr Manufacturer Warranty Black
  • YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
  • LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
  • MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
  • NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
  • BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.

Choose the screenshot scope and format

Need Method Result
Visible browser view driver.save_screenshot("page.png") or driver.get_screenshot_as_file("page.png") PNG file of the current browser view. The file method returns False for an I/O error and expects a .png filename.
Screenshot data for further processing Use the driver’s PNG-bytes or base64 screenshot API. Image data rather than only a saved file.
One visible component Call the screenshot method on the relevant WebElement. PNG screenshot scoped to that element.

See the Selenium Python WebDriver API for driver screenshot methods. For element screenshots, consult Selenium’s working with windows and tabs documentation, which covers WebElement screenshot usage.

A standard current-window screenshot should not be assumed to capture an entire long, scrollable document in every browser. If you need a full-page image, verify support for your specific browser and capture method instead of treating the normal viewport call as a full-page guarantee.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Tracfone Motorola Moto G 2025, 64GB, Saphire Blue (Locked to
  • Carrier: This phone is locked to Tracfone, which means this device can only be used on the Tracfone wireless network. Tracfone plan required, activating is easy, just 3 steps.
  • DISPLAY: Immersive viewing on a 6.7-inch super-bright 120Hz display with powerful stereo speakers and Bass Boost for cinematic entertainment.
  • CAMERA SYSTEM: Advanced 50MP Quad Pixel camera captures sharp, detailed photos and videos in any lighting condition
  • PERFORMANCE: Lightning-fast 5G connectivity paired with a powerful processor and RAM Boost for smooth multitasking.
  • BATTERY LIFE: Long-lasting 5000mAh battery with TurboPower charging technology delivers hours of power in minutes.

Handle OTP and session flow without losing the logged-in state

  1. Open the authorized site using the WebDriver instance that will take the screenshot.
  2. Complete the site’s regular OTP challenge and proceed to the protected destination in that same browser session.
  3. Wait for an element or state that identifies the actual authenticated content, not merely the disappearance of the login form.
  4. Capture the current view or a specific element using the method that matches your intended evidence.

If login opens a new tab or window, switch WebDriver to that browsing context before waiting for the page and capturing it. Selenium’s remote WebDriver API exposes the current URL, window handles, and cookies for its active session; see the remote WebDriver API documentation. You generally do not need to copy or manipulate authentication cookies for this workflow.

Troubleshoot common failures

  • The image shows a login page. Confirm the OTP challenge completed, the authenticated page opened in this same driver session, and the site did not redirect back to login. If a new window or tab opened, switch to it before capturing.
  • The screenshot is blank or missing page content. Wait for a meaningful page element or for the relevant loading indicator to disappear. A completed navigation or document.readyState == "complete" alone may not mean a dynamic application has finished rendering.
  • The wait times out. Check that the selector matches the authenticated page, that the page has actually reached the expected destination, and that the element becomes visible rather than merely existing in the DOM. A site’s OTP or redirect flow may take longer or behave differently; adjust the condition and timeout based on the actual page.
  • No screenshot file appears. Check that the process can write to the destination path and that the filename ends in .png. For get_screenshot_as_file, check its return value for an I/O failure.
  • The capture omits the lower part of a long page. The ordinary driver screenshot is for the current browser view; validate a browser-specific full-page method if the entire document is required.

Protect screenshots of account pages

An authenticated screenshot may visibly include names, balances, addresses, or other personal information. Save it only where intended, avoid accidentally publishing it in logs or shared folders, and remove it when it is no longer needed. This is a practical handling precaution, not a conclusion about the legal rules for any particular site or data.

Rank #4
Sale
Samsung Galaxy A17 5G Smart Phone 128GB, US 1 Yr Manufacturer Warranty Blue
  • YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
  • LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
  • MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
  • NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
  • BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.
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 is a website screenshot API and MCP server. For a page you can access publicly, one GET request can return a screenshot or PDF. This is not a way to complete an OTP challenge or capture a private page that requires an authenticated browser session.

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

See the ScreenshotNeo documentation for the API. Before capture, ScreenshotNeo can accept cookie or consent banners like a visitor and remove more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers identify the page verdict and billing status. Its MCP server includes take_screenshot, get_page_info, and capture_pdf for AI agents. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.

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

Sign up for ScreenshotNeo’s free 1,000 screenshots per month, with no card required.

Best Value
Sale
Samsung Galaxy A16 5G 128GB Cell Phone, Unlocked Android Smartphone, Large AMOLED Display, Durable Design, Super Fast Charging, Expandable Storage, US Version, 2025, Blue Black (Renewed)
  • Charger NOT Included, 6.7" Super AMOLED FHD+, 90Hz Refresh Rate, 385 ppi, 800 nits (HBM), 1080x2340px, 5000mAh Battery
  • 128GB, 4GB RAM, microSDXC, Exynos 1330 (5nm), Octa-Core, Mali-G68 MP2 or Mali-G57 MC2 GPU
  • Rear Camera: 50MP, f/1.8 (wide) + 5MP, f/2.2 (ultrawide) + 2MP, f/2.4 (macro), LED flash, panorama, HDR; Front Camera: 13MP, f/2.0, Android 14, up to 6 major Android upgrades, One UI 6.1
  • 3G: HSDPA 850/900/1700(AWS)/1900/2100; 4G LTE: 1/2/3/4/5/7/12/13/14/20/25/26/28/29/30/38/39/40/41/48/66/71, 5G: 2/5/25/41/66/71/77/78 SA/NSA/Sub6/mmWave - Nano-SIM + eSIM
  • US Model – Global Connectivity – Compatible with Most GSM Carriers like T-Mobile, AT&T, MetroPCS, etc. Will Also work with CDMA Carriers Such as Verizon, Straight Talk.

Frequently Asked Questions

Does Selenium bypass an OTP login?

No. Complete the site’s authorized OTP challenge through its normal login flow; Selenium can capture the page after that session reaches the authenticated content.

Can I use this method on any Indian website?

The general WebDriver workflow applies, but OTP delivery, page selectors, redirects, and site automation rules vary by website. There is no single India-specific Selenium procedure.

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.