How to Use an AI Agent to Capture Screenshots of Indian Real Estate Listing Pages
Capture a property listing with an AI agent using Playwright, choose the right screenshot scope, and handle access, privacy, and troubleshooting carefully.
Use a browser automation tool such as Playwright to open the listing page you are authorized to access, let its main content render, and capture the viewport, a specific element, or the full page. Use an accessibility snapshot and current element references to understand and operate the page; take a screenshot when visual appearance matters or when a map, canvas, or custom widget is not exposed in the accessibility tree. Do not bypass logins, CAPTCHAs, paywalls, or anti-bot controls. A screenshot records a rendered page state at a point in time; it does not verify the listing’s accuracy or permission to reuse its content.
1. Check access and choose the capture scope
Start with the exact portal and listing URL. Review that portal’s current terms and access restrictions before automating. Terms are site-specific: eRealtor, for example, has terms addressing browsing listings and unauthorized access, but that is not evidence about other portals’ rules. A page being publicly visible or indexed does not itself establish permission to automate or copy it.
| Method | Use it when | Trade-off |
|---|---|---|
| Viewport | You need the visible page state or a focused view. | Fast and compact, but does not include content farther down the page. |
| Element | You need one known listing card, image, or detail panel. | Excludes unrelated page content; the selector must identify the intended element. |
| Full page | You need the full scrollable listing in one image. | Can be very tall, larger, and include unrelated content. Playwright’s screenshot interface does not combine full-page mode with an element target. |
| Accessibility snapshot | You need to find and operate controls or understand page structure. | Structured information rather than a visual image; use a screenshot as a complement where visual appearance matters. |
Prefer the smallest scope that serves your purpose. This reduces irrelevant content and makes the result easier to review. If a property map or gallery is rendered in a canvas or custom widget, a screenshot can show visual information that may not appear in the accessibility tree.
2. Capture a listing with Playwright
The following runnable Node.js example opens a URL, waits for a listing heading, and captures a full-page PNG. Install Playwright and its Chromium browser first. Set LISTING_URL to a page you may access.
npm install playwright
npx playwright install chromium
# Save the script below as capture-listing.mjs, then run:
LISTING_URL='https://example.com/listing' node capture-listing.mjs
import { chromium } from 'playwright';
const url = process.env.LISTING_URL;
if (!url) throw new Error('Set LISTING_URL to an authorized listing URL.');
const browser = await chromium.launch({ headless: true });
const page = await browser.newPage({ viewport: { width: 1440, height: 1000 } });
try {
await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 45_000 });
// Prefer a meaningful page-specific readiness condition over a fixed delay.
// Replace this selector with a heading or listing container used by the portal.
const heading = page.getByRole('heading', { name: /property|listing/i }).first();
try {
await heading.waitFor({ state: 'visible', timeout: 10_000 });
} catch {
// Some pages use different markup. Review the page before relying on the image.
}
await page.screenshot({ path: 'listing.png', fullPage: true, type: 'png' });
console.log('Saved listing.png');
} finally {
await browser.close();
}
Playwright supports viewport, element, and full-page screenshots, along with PNG, JPEG, and WebP output and CSS-pixel or device-scale capture. See the Playwright screenshot documentation. For reliable page interaction, use the agent’s accessible snapshot and references from the current page state; after navigation or a meaningful state change, refresh the snapshot and use current references. See Playwright accessibility guidance.
Capture a viewport, element, or alternate format
// Current viewport, PNG
await page.screenshot({ path: 'viewport.png', type: 'png' });
// A known listing panel; replace with a selector observed on this page
await page.locator('[data-testid="listing-details"]').screenshot({ path: 'details.webp', type: 'webp' });
// Full-page JPEG
await page.screenshot({ path: 'listing.jpg', fullPage: true, type: 'jpeg', quality: 85 });
// Higher pixel density for a viewport capture
await page.screenshot({ path: 'retina.png', scale: 'device' });
Use CSS scale when CSS-pixel dimensions are suitable; use device scale when you need higher pixel density and can accept a larger image. JPEG quality applies to JPEG output. PNG is lossless and can be larger; WebP can be useful where the downstream viewer supports it. Check the actual output dimensions and legibility for the intended use.
Guide the agent without treating the screenshot as the interface
- Open the permitted listing page and inspect its accessible snapshot.
- Use current references to navigate or expand the relevant listing section; do not guess at hidden controls.
- Wait for a meaningful readiness signal, such as the listing heading or main image becoming visible. Refresh the snapshot after navigation or page changes.
- Capture the smallest scope that preserves the information needed. Use a screenshot to inspect visual features that the accessibility tree does not expose.
- Save a descriptive filename and, where useful, a capture timestamp. Review the image before sharing or retaining it.
Do not assume one fixed delay works on every portal. Dynamic images, consent prompts, and page controls vary. Full-page capture may not include content that only loads after scrolling; if needed, scroll through the permitted page and allow its images to load before taking the final capture. Do not defeat access controls to make content appear.
3. Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server. One GET request can return a screenshot or PDF. Its clean-shot flow accepts consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks, blank pages, failed loads, timeouts, and cache hits cost nothing, and response headers indicate the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients. The free plan includes 1,000 shots per month with no 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/listing -o listing.webp
Use an API key from your account. Review the returned headers and image before treating the request as a successful capture. Only use the service with pages you are authorized to access. Sign up for 1,000 free screenshots a month, with no card required.
4. Handle listing data and screenshots carefully
Real estate screenshots may expose phone numbers, names, faces, account details, or other personal information. Avoid logged-in or private material unless you are authorized to capture it. Keep files in a controlled location, restrict access, and retain only what your purpose requires.
India’s Digital Personal Data Protection Act, 2023 concerns processing digital personal data, and its text provides for provisions to commence on dates appointed by the Central Government. The Press Information Bureau reported that the Digital Personal Data Protection Rules, 2025 were notified on 14 November 2025. Check the official Act, applicable rules, and commencement notices for the date and processing involved; do not assume every provision has the same commencement status. The government’s 2023 summary of the Bill describes principles including purpose limitation, data minimisation, storage limitation, and security safeguards; it is a summary, not a substitute for the Act or current rules. Sources: India Code, Digital Personal Data Protection Act, 2023; PIB report on notification of the DPDP Rules, 2025; PIB summary of the DPDP Bill, 2023.
A screenshot is evidence of what a browser rendered at capture time. It does not prove that the price, availability, ownership, RERA registration, or other listing claims are current or true. Do not republish listing content based on the act of capturing it; check the portal’s terms and obtain any necessary permission for the intended use.
5. Troubleshooting
| Symptom | Likely cause | What to do |
|---|---|---|
| Navigation times out | The page is slow, blocked, or waiting on resources that never settle. | Use a suitable navigation milestone such as domcontentloaded, set a reasonable timeout, then wait for a page-specific element. Do not repeatedly retry in a way that evades a site restriction. |
| Screenshot is blank or missing listing content | The capture happened before the content rendered, or the page requires authorized interaction. | Wait for a meaningful visible element and inspect the page state. If a login or access challenge appears, stop unless you have an authorized route. |
| Element selector finds nothing | The selector is not present on this portal or changed with the page state. | Inspect the current DOM or accessible snapshot, then choose a selector for the actual listing element. Refresh references after navigation. |
| Full-page image omits lazy images | Images load as the page scrolls. | Scroll through the page where permitted, wait for the relevant images, then capture. Review the result instead of assuming every image loaded. |
| Image is too large or hard to read | Full-page dimensions or device scale exceed the intended display size. | Capture only the relevant element or viewport, use CSS scale, or choose a supported compressed format and inspect legibility. |
| Map or custom widget is absent from agent snapshot | The widget is not represented as accessible structure. | Use a screenshot as a visual complement. Do not infer data that is not visible or accessible. |
| Portal shows a CAPTCHA, bot check, or paywall | The site is restricting access or requiring a permitted session. | Do not bypass it. Use an authorized access method or stop the capture. |
6. Performance, reliability, and cost
For a local Playwright workflow, browser startup and page loading are part of each run; reusing a browser process can avoid repeated startup in a batch job. Full-page captures and high device scale increase image dimensions, memory use, and output size. Element and viewport captures are usually more focused. No fixed capture time or success rate applies across property portals: rendering, login state, lazy loading, and site restrictions vary.
For dependable records, save the source URL and capture time alongside the image, check that the file exists and is non-empty, and visually review it. A successful screenshot operation only means an image was produced; it does not validate listing claims. For an API workflow, ScreenshotNeo’s stated plans are Free: 1,000 shots/month; Starter: $5 for 3,000; Growth: $15 for 15,000; Pro: $39 for 60,000; Scale: $99 for 250,000; Business: $249 for 1,000,000. Yearly billing gives two months free, and every feature is on every plan. Billing exclusions and response headers are described in the product documentation; consult it for current request behavior.
7. Frequently asked questions
Can an AI agent save a listing as an image?
Yes, if it can access the page through an authorized browser session and its automation tool supports screenshots. The result reflects the rendered page state at capture time.
Should the agent use a screenshot to find page controls?
Usually use the accessible snapshot and current element references to locate and operate controls. A screenshot helps when visual appearance matters or a widget is not exposed in the accessibility tree.
Does a full-page screenshot prove the listing is still available?
No. It records a page state at the time of capture and does not verify later availability or the truth of the listing.
Can I use the screenshot to republish a property listing?
Capture permission and reuse permission are separate questions. Check the specific portal’s terms and obtain any permission needed for your intended reuse.


