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 4 with Chrome’s headless mode, set a fixed viewport, wait for a visible element that proves the municipal page is ready, then save the current window with driver.save_screenshot(). That produces a PNG of the viewport—not automatically a full-page image. The example below gives you a reproducible starting point for a public page; replace its URL and wait condition with the page you need to capture.
Capture a municipal page with Selenium and Python
Install Selenium for Python and have a compatible Chrome browser available. Selenium’s current documentation identifies the examples below with Selenium 4.50.0; check the documentation for the browser and driver versions installed in your environment. The code uses Selenium Manager through webdriver.Chrome() to obtain a driver when needed.
from pathlib import Path
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
url = "https://example.gov.in/" # Replace with the intended public municipal page.
out = Path("screenshots/municipal-home.png")
out.parent.mkdir(parents=True, exist_ok=True)
options = Options()
options.add_argument("--headless")
options.add_argument("--window-size=1440,1200")
driver = webdriver.Chrome(options=options)
try:
driver.set_page_load_timeout(45)
driver.get(url)
# Replace with a stable, visible element on the actual page.
WebDriverWait(driver, 20).until(
EC.visibility_of_element_located((By.TAG_NAME, "body"))
)
saved = driver.save_screenshot(str(out))
if not saved or not out.is_file():
raise RuntimeError(f"Screenshot was not saved: {out}")
finally:
driver.quit()
Selenium’s Python API documents save_screenshot(path) as saving a PNG screenshot of the current window. Use a path ending in .png; the method returns False if an I/O error prevents saving. The script creates the output directory first, checks both the return value and file existence, and closes the browser even if navigation, waiting, or saving raises an error. See the Selenium Chrome Python API.
Wait for the content you actually need
The sample waits for the page’s body, which is only a basic readiness check. Replace it with a stable selector for the page heading, property-tax panel, service notice, or other content that must appear in the image. Selenium explains that document readiness does not guarantee that JavaScript-driven changes have finished rendering; wait for the actual element or condition needed before capturing. See Selenium’s waiting strategies.
#1 Best Overall
Prefer explicit waits such as WebDriverWait over fixed sleeps as the synchronization strategy. Do not combine implicit and explicit waits: Selenium warns that mixing them can produce unpredictable wait times.
Choose the capture area: viewport or full page
Viewport screenshot
driver.save_screenshot() captures the current window. Set the window size before navigation or capture, as in the example, because viewport dimensions can change responsive layout, line wrapping, and visible content. A viewport capture is appropriate when you need a specific screen state, such as the visible service panel or the desktop layout.
Rank #2
Full-document screenshot
For a page taller than the viewport, do not label a standard window screenshot as full-page. Full-document methods are browser-specific: Selenium’s Firefox Python API documents methods such as get_full_page_screenshot_as_file(...). Verify that the method is supported by the browser and driver versions you use. See the Selenium Firefox Python API.
Recommended Free Tools
If your chosen configuration has no supported full-page method, a scroll-and-stitch workflow is an alternative, but inspect the result for seams, sticky headers or banners repeated in each segment, and content that loads only when scrolled into view. Selenium also documents printing to PDF in headless Chromium; that can work for an archival reading copy, but it is a PDF rather than a screenshot. See Selenium’s Chrome browser documentation.
Make captures repeatable and interpretable
For a capture that someone else can understand or reproduce, save a record beside the image. Note the source URL, capture date and time, viewport dimensions, browser and browser-driver versions, operating system, locale, and any relevant page state. These are reproducibility practices, not results from a test of any specific municipal portal.
A filename can encode the page, viewport, and date, for example pune-property-tax-desktop-1440x1200-2026-10-03.png. Keep a companion text record with the source URL and capture settings. If the image is used in a public report, retain enough context to distinguish the original capture from any later edits.
Use automation responsibly on municipal portals
The Government of India’s Guidelines for Indian Government Websites and Apps (GIGW) state that their scope includes websites and applications at central, state, district, and local-government levels. The guidance addresses usability, accessibility, and security; it does not establish that a particular municipal portal permits automated access or screenshot republication. The GIGW 3.0 landing page, published by MeitY, showed a last-updated date of September 25, 2026.
Rank #4
- Vivid Full HD 1080P Video Quality: Experience crisp, professional video with the DICCIK 1080p webcam. Delivering 1920 x 1080 resolution at a fluid 30fps, this web camera ensures clear images for every online calling session. Whether you are streaming or recording, it is a reliable computer camera that outperforms standard laptop cameras.
- Integrated Microphone for Clear Audio: This pc webcam features a built-in noise-reducing mic. Designed as a computer camera with microphone for desktop, it captures your voice naturally while filtering background noise. Perfect for busy home offices, ensuring you are heard loud and clear on Zoom, Skype, and FaceTime.
- Instant Plug and Play USB Connection: No software or drivers required. Our usb webcam is a true plug and play solution for your PC or Mac. Simply connect the camera for pc to your USB port, and it’s ready in seconds. The flexible clip makes it an easy-to-install monitor camera or desktop camera.
- Automatic Light Correction for Dim Lighting:Look your best even in low-light environments. This computer camera for desktop automatically adjusts brightness and white balance to match your room's light. From bright offices to dim bedrooms, this streaming webcam ensures a professional look without extra ring lights.
- Wide Compatibility for Work and Play:A versatile pc camera webcam that works seamlessly with Windows 7/10/11, macOS, and Linux. This webcam for mac and webcam for laptop is fully optimized for Microsoft Teams, Google Meet, and YouTube. An essential camera for computer users across all major operating systems.
Before automating a target portal or sharing its images, review its published terms, access controls, and notices. Keep requests conservative and limited to the pages you need. Do not attempt to evade a login, CAPTCHA, rate limit, or other access control. Requirements depend on the particular site and intended use; there is no single permission or request-rate rule established here for every municipal website.
Troubleshoot common capture problems
- The page loads, but the service panel is missing: navigation completion may precede JavaScript rendering. Replace the sample body wait with an explicit wait for the panel or heading you need.
- The screenshot has the wrong layout or dimensions: set a deliberate window size and keep it consistent between runs. Record the viewport because responsive breakpoints and text wrapping can change.
- The image cuts off lower content: the general Python screenshot method captures the current window, not a guaranteed full document. Use a supported browser-specific full-page API, inspect a scroll-and-stitch result, or use headless Chromium’s print-to-PDF option if a PDF is acceptable.
- No PNG appears at the expected path: verify the path and that its parent directory exists. Check the Boolean returned by
save_screenshot()and the file-existence check; the example raises an error if saving fails. - The script waits too long or times out: confirm that the selector exists and is visible on that page, and choose a condition that matches the content you need. A timeout is not proof the site is unavailable; the target element may have changed or failed to render.
- Wait durations behave unpredictably: avoid mixing implicit and explicit waits. Use explicit waits tied to the relevant page condition.
Or skip the browser setup
ScreenshotNeo offers a screenshot API and MCP server. One GET request can return an image or PDF; clean-shot options accept consent banners and remove more than 60 known consent platforms, newsletter popups, and chat widgets before capture, with each cleanup step configurable. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify 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 screenshots a month with no card; paid plans start at $5 for 3,000.
For example, save a PNG for a public municipal page with cURL:
Best Value
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.gov.in/ -o municipal-home.webp
See the ScreenshotNeo API documentation for setup and options. Sign up free for 1,000 screenshots a month with no card.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Frequently Asked Questions
Does Selenium’s standard screenshot method save a full-page PNG?
No. The general Python method captures the current window; full-document capture depends on browser-specific support.
Can I automate every Indian municipal website?
The cited GIGW scope does not establish permission for automation or republication on a particular portal. Check that site’s terms, notices, and access controls.
Quick Recap
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.

