How to Use an AI Agent to Capture Screenshots of Indian Job Listing Pages
Use an AI agent and Playwright to find the right job listing, choose a screenshot scope, and save a useful visual record—with a one-call API option.
An AI agent can capture an Indian job listing by opening the page in a browser automation session, checking that it reached the intended listing, and taking a screenshot of the viewport, a specific element, or the full scrollable page. This guide uses Playwright with Node.js. The same workflow applies to other browser agents that expose page navigation and screenshot tools.
First check that the portal permits your intended access. The sources here do not establish the current access rules for any specific Indian job site. If a page requires login, blocks automation, or presents a challenge, stop and use an allowed route; do not try to bypass access controls.
1. Choose what the screenshot needs to show
| Scope | Use it when | Trade-off |
|---|---|---|
| Viewport | You need the current visible screen and its surrounding context. | Content below the fold is omitted. |
| Specific element | The listing is in a discrete card or detail panel that you can identify reliably. | You need a correct selector, and the capture excludes the rest of the page. |
| Full page | Below-the-fold details matter and one tall image is useful. | The result can be very tall. Playwright’s browser-agent documentation says full-page capture cannot be combined with targeting a single element. |
Playwright describes its screenshot tool as supporting “the viewport, a specific element, or the full scrollable page.” Use page structure or an accessibility snapshot to locate and verify the intended listing; a screenshot is for visual inspection and does not, by itself, establish that you found the right job or that its text is accurate. See the Playwright browser-agent screenshot documentation.
2. Capture a listing with Playwright
This runnable Node.js example opens a listing URL supplied on the command line, checks the page title, and saves a full-page screenshot. It uses a normal browser session and does not attempt to evade login, bot checks, or site restrictions.
npm init -y
npm install playwright
npx playwright install chromium
# Save the script below as capture-job.js, then run:
node capture-job.js "https://example.com/job-listing"
const { chromium } = require('playwright');
async function main() {
const targetUrl = process.argv[2];
if (!targetUrl) {
throw new Error('Usage: node capture-job.js <listing-url>');
}
const browser = await chromium.launch({ headless: true });
const page = await browser.newPage({ viewport: { width: 1440, height: 1000 } });
try {
const response = await page.goto(targetUrl, {
waitUntil: 'domcontentloaded',
timeout: 60000,
});
if (!response) {
throw new Error('Navigation did not return a response. Check the URL and access requirements.');
}
if (!response.ok()) {
throw new Error(`Page returned HTTP ${response.status()}.`);
}
// Verify the destination before treating the image as evidence.
await page.locator('body').waitFor({ state: 'visible', timeout: 15000 });
const pageTitle = await page.title();
console.log(`Page title: ${pageTitle}`);
console.log(`Final URL: ${page.url()}`);
// Capture the entire scrollable page. For a viewport-only image, use
// page.screenshot({ path: 'job-listing.png' }) instead.
await page.screenshot({ path: 'job-listing.png', fullPage: true });
console.log('Saved job-listing.png');
} finally {
await browser.close();
}
}
main().catch((error) => {
console.error(error.message);
process.exitCode = 1;
});
Replace the example URL with a listing you are allowed to access. The script logs the page title and final URL so you can catch redirects or an unexpected destination. It saves the PNG in the current working directory. Playwright’s screenshot guide documents file output, full-page capture, image-buffer output, and locator screenshots.
3. Adapt the capture to the listing
Capture only the viewport
For a record of what a person sees without scrolling, use:
await page.screenshot({ path: 'job-listing-viewport.png' });
The viewport dimensions come from the browser context or page configuration. Set them to the dimensions you want to represent; the example uses 1440 by 1000 CSS pixels.
Capture one listing element
If the page contains multiple job cards, first identify the intended one by its visible text or accessible structure. Then capture its locator:
const listing = page.getByRole('article').filter({ hasText: 'Software Engineer' }).first();
await listing.waitFor({ state: 'visible', timeout: 15000 });
await listing.screenshot({ path: 'job-listing-card.png' });
This locator is an example, not a selector guaranteed to work on every portal. Inspect the page structure and use a locator that uniquely matches the intended listing. If several cards match, refine the locator before capture. A full-page screenshot and an element-targeted screenshot are different scopes; do not try to combine them.
Save image bytes instead of writing a file
Playwright can return screenshot bytes for storage or processing by your own application:
const imageBytes = await page.screenshot({ fullPage: true });
// Pass imageBytes to an approved storage or processing step.
For a smaller full-page result, consider whether a viewport or element capture meets the need. Full-page output may be large because it includes all scrollable content.
4. Make the record identifiable
A screenshot can lose context when separated from the browser session. As a practical filing convention, record the portal or employer, role, location if relevant, and capture date in the filename or accompanying metadata. For example: company-role-location-2026-10-04.png. This is a suggested organization practice, not a Playwright requirement.
Before relying on the image, check the saved result and confirm that it shows the intended listing, including the relevant details. For long pages, confirm the lower sections were included. Keep a note of the source URL and capture time alongside the file if those matter to your use case.
5. Use an AI agent with browser tools
In an agent workflow, ask the agent to navigate to the supplied listing, inspect page structure or accessible content to verify the role and employer, choose a capture scope, and save the screenshot. Browser snapshots and accessible structure help an agent interact with a page; the screenshot provides the visual record. Playwright documents screenshot tools for browser agents as well as page screenshots in its browser-agent documentation.
Keep the verification step explicit. A successful navigation can still land on a search page, login screen, unavailable listing, or redirect. If the agent cannot confirm the intended listing, it should report that and avoid labeling the image as a verified capture.
6. Troubleshooting
| Symptom | Likely cause | What to do |
|---|---|---|
| Navigation times out | The page is slow, unreachable, or waiting on activity that does not finish. | Check the URL and permitted access in a regular browser. The example waits for DOM content rather than every network request; increase the timeout only when there is a clear reason. Do not treat a timeout as a successful capture. |
| HTTP error or unexpected final URL | The listing may be unavailable, redirected, or require a different access path. | Check the response status, final URL, and page title. Use an allowed route or stop if access is denied. |
| Screenshot is blank or incomplete | The page may not have rendered the relevant content yet, or the capture scope may be wrong. | Wait for a relevant visible locator when one is available, inspect the page, and choose viewport, element, or full page deliberately. Do not assume a fixed delay works for every site. |
| Element locator times out | The example role or text does not match the site’s markup, or the target listing is absent. | Inspect accessible structure and page content, then use a locator that identifies the correct card. If you cannot identify it confidently, capture a broader scope or report the limitation. |
| Capture contains a login page or challenge | The portal requires access or is blocking the session. | Do not attempt to bypass the control. Use a permitted browser session or official access route; otherwise stop. |
| Full-page image is too tall or unwieldy | The page has extensive content or repeated sections. | Use a viewport or the specific listing element if that preserves the evidence you need. |
7. Performance, reliability, and cost
Browser automation launches and controls a browser, so the work includes browser startup, navigation, page rendering, and image creation. A viewport or element capture can produce a more focused artifact; a full-page capture covers more content and may create a taller image. These are scope trade-offs, not universal performance measurements. Reuse a browser process for multiple permitted captures when building a larger workflow, and close pages and browsers when finished.
Reliability depends on verifying the destination and capture result. Pages can change, listings can disappear, and access requirements vary by portal. Preserve the source URL and capture time when you need traceability. The research sources do not establish the terms, availability, or automation rules of any particular Indian job portal, so check the chosen portal’s current rules.
Playwright is an open-source browser automation framework; the cited documentation does not prescribe a universal cost for running it. Your runtime, compute, storage, and any services you choose to use determine operational cost. Avoid retries that repeatedly hit a page that is denying or challenging access.
Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server. Its API can return a screenshot or PDF with one GET request. For an Indian listing URL you are allowed to access, replace the example target below with that URL. Read the ScreenshotNeo API documentation for parameters and options.
curl -G "https://api.screenshotneo.com/v1/shot" \
-d access_key=YOUR_API_KEY \
--data-urlencode url=https://example.com/job-listing \
-o job-listing.webp
import requests
r = requests.get(
"https://api.screenshotneo.com/v1/shot",
params={"access_key": "YOUR_API_KEY", "url": "https://example.com/job-listing"},
timeout=90,
)
r.raise_for_status()
open("job-listing.webp", "wb").write(r.content)
const q = new URLSearchParams({
access_key: 'YOUR_API_KEY',
url: 'https://example.com/job-listing',
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot request failed: ${res.status}`);
const image = Buffer.from(await res.arrayBuffer());
require('node:fs').writeFileSync('job-listing.webp', image);
ScreenshotNeo removes cookie banners, popups, and chat widgets before the shot. Bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots. The Free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 screenshots. Check the response’s X-Page-Verdict and X-Billed headers to see the page outcome and billing status. Use only on pages you are permitted to access.
Sign up for 1,000 free screenshots a month, with no card required.
FAQ
Does the title imply this works with every Indian job portal?
No. Browser automation is a capture method; each portal has its own access requirements and rules. Check the specific site’s current terms and use an allowed route.
Should I save a screenshot or a browser snapshot?
Use a screenshot for visual inspection and a browser snapshot or accessible page structure to help identify and interact with the listing. They serve different purposes.
Can I capture just one listing from a search results page?
Yes, if you can identify its element reliably. Use a locator screenshot and verify that it matched the intended listing before saving it as evidence.
Can I use a full-page screenshot and an element target together?
No. Playwright’s browser-agent screenshot documentation says full-page capture cannot be combined with targeting a single element. Choose the scope that fits the record you need.


