ScreenshotNeo

BlogHow-to

How to Get urlwatch Alerts for Indian Railway and Transport Website Updates

Set up urlwatch to track official railway and transport notices, filter irrelevant changes, and send alerts on a schedule.

By the ScreenshotNeo team4 October 20268 min read

To get alerts when Indian railway or transport websites update, install urlwatch, add one job for each official page in urls.yaml, configure an enabled reporter in urlwatch.yaml, and run urlwatch on a schedule. Use a normal URL job for server-rendered pages, a browser job for JavaScript-rendered pages, and filters to focus alerts on the notice list or section you care about. urlwatch compares the result of each run with a saved prior result; it does not watch continuously between scheduled runs.

This guide covers notice pages such as recruitment, tender, circular, timetable-release, and zonal railway announcements. For live train-running enquiries, use the official Indian Railways passenger enquiry portal and its NTES links: monitoring a page for edits is not a substitute for a live status enquiry. Verify the relevant agency’s current page address and timetable effective date before relying on a link; transport sites and their page structures change.

1. Install urlwatch and make an initial run

Follow the urlwatch handbook installation instructions for your operating system and Python environment. There is no single install command that is correct for every platform and environment. After installation, run urlwatch once. The handbook’s quick start then uses urlwatch --edit to edit jobs and filters and urlwatch --edit-config to edit settings and reporters.

urlwatch
urlwatch --edit
urlwatch --edit-config

The first run creates or initializes the configuration and state files. Keep those files and the state database in the same account and environment that will run the scheduled checks; a scheduler running as another user may not see them.

2. Choose official pages and create jobs

Start with the official listing page that publishes the information you need, rather than a broad home page. Examples include an official recruitment notice listing, a tender index, a circular archive, or a zonal railway announcement page. Add a separate named job for each page so that a change report identifies what changed.

Use url when the relevant text is present in the HTTP response. Use navigate when the page builds the relevant content in a browser with JavaScript. The urlwatch handbook documents job kinds and their configuration; consult it for the installed version’s syntax and browser setup requirements. A command job is appropriate only when you genuinely need a command-line retrieval step.

# urls.yaml — illustrative job structure; replace the example URL with a verified official page.
name: Example railway recruitment notices
url: https://example.gov.in/recruitment/notices

The URL above is a placeholder, not a verified railway page. For a JavaScript-rendered page, the job instead needs the handbook’s browser job configuration, typically using the navigate job type. Confirm that the page works in the browser environment used by urlwatch, including any required browser dependencies, before relying on it.

For Indian railway information, distinguish among:

  • Notices and publications: monitor the official announcement or archive page for updates.
  • Timetable publications: monitor the official current publication page and check the stated effective date. Historical timetable links can remain visible after they are obsolete.
  • Live train running and station enquiries: use NTES through the official passenger enquiry route. The reviewed Ministry of Railways material describes NTES as a near-real-time train-running information service; urlwatch alerts only when its monitored page output changes.

3. Filter out unrelated page changes

Pages often include navigation, rotating banners, timestamps, counters, or other content that changes without changing the notice you care about. Add a CSS or XPath filter to select the notice list or content element, then use text cleanup or matching filters if needed. The urlwatch handbook documents filters and job configuration. Test the filtered output, not just whether the page loads: a filter can go stale after a site redesign or a changed element identifier.

A practical filtering workflow is:

  1. Run the job once and inspect the fetched content.
  2. Identify a stable container around the relevant notices or table.
  3. Apply a CSS or XPath element filter using syntax supported by your installed urlwatch version.
  4. Run it again and confirm that the output contains the desired text and omits unrelated sections.
  5. Revisit the filter after a site redesign, an unexpectedly empty result, or a sudden large diff.

Do not filter so narrowly that a new notice format or a changed heading disappears from the result. If the page provides downloadable PDFs rather than useful HTML, monitor the official listing page for new links or use an appropriate retrieval job for the linked document, checking the handbook for supported filters and content handling.

4. Configure an alert reporter

urlwatch can report through terminal output, SMTP email, and documented third-party reporters such as Telegram, Slack, Discord, Matrix, Pushbullet, and Pushover. Choose a channel you can inspect, configure its credentials in urlwatch.yaml, and ensure the reporter is enabled. Follow the handbook for the exact configuration keys and required credentials for your chosen reporter; those details vary by service and urlwatch version.

Reporter support does not mean that the external service is free, available in every location, or guaranteed to deliver every message. Protect SMTP passwords, bot tokens, and webhook credentials as secrets. Do not commit them to a public repository. Send a test change through the configured path and confirm that the notification includes enough context to identify the page and inspect the diff.

5. Schedule checks at a reasonable interval

urlwatch only checks when its process runs. Schedule it with cron or another operating-system scheduler, using the same user and configuration directory as your initial run. The handbook’s quick-start guidance recommends not checking more often than every 30 minutes. For public agency notices, select a longer interval if that meets your needs and avoids unnecessary requests.

With cron, use the full path to the urlwatch executable and redirect output to a log you can review. The exact executable path and environment depend on how it was installed, so find them in your own environment rather than copying an assumed path.

# Example cron entry; replace /path/to/urlwatch and /path/to/urlwatch.log.
*/30 * * * * /path/to/urlwatch >> /path/to/urlwatch.log 2>&1

This example runs every 30 minutes. If the scheduler uses a different home directory, Python environment, or configuration path, urlwatch may behave as though it has no jobs or state. Confirm scheduled-run output after adding the task.

6. Interpret changes and errors correctly

Each run retrieves the page, applies the configured filters, and compares the resulting output with the prior run. Depending on configuration, urlwatch can report new, changed, unchanged, or errored results. A retrieval error or website outage is not proof that the page itself changed. Inspect the status and diff before acting on an alert, especially for pages that affect travel or deadlines.

For high-consequence notices, use urlwatch as a change prompt, then confirm the information on the official page or document. Alert delivery depends on the scheduler, network access, site availability, reporter configuration, and the external delivery service; it is not an instant or guaranteed channel.

7. Common problems and fixes

Symptom Likely cause What to check
No alerts arrive The reporter is missing, disabled, or misconfigured; the scheduled command uses a different configuration; or the filtered output has not changed. Run urlwatch manually as the scheduled user, inspect its output and logs, verify reporter settings and credentials, then trigger a known change in a test job.
The job reports an error The site is unavailable, the URL changed, a request was blocked, or the network/browser environment failed. Open the URL from the machine running urlwatch, inspect the error details, and retry later before treating it as a content change.
The page loads but the notice is missing The relevant content is rendered with JavaScript, or the filter targets the wrong element. Inspect the returned content; switch to the documented browser job type if rendering is required, then test and revise the selector.
Every run sends a large diff Unrelated page regions are changing, or the page contains dynamic values. Filter to a stable notice container and remove irrelevant changing text with supported filters. Check that important notice content remains.
Alerts stopped after a redesign The URL or filter selector may have changed, or the page moved to a different rendering method. Recheck the official listing page, inspect current HTML or browser output, update the job, and verify the filtered result.
Manual runs work but cron does not Cron uses a different user, executable, environment, working directory, or configuration path. Use the installed executable’s full path, run as the intended user, and inspect redirected logs and environment-specific configuration.
A timetable link appears current but has an old date Older documents may remain linked on official pages. Check the document’s effective date and verify the latest official timetable publication before using it.

8. Performance, reliability, and cost

urlwatch performs work at scheduled intervals rather than continuously. Your request volume grows with the number of jobs and how often they run; avoid unnecessarily short intervals, especially across many pages. Browser jobs generally require more local setup and resources than fetching ordinary server-returned HTML, so reserve them for pages that need rendering. Filters reduce noisy reports but need maintenance when page markup changes.

The setup uses the machine or server where urlwatch runs, its scheduler, and an alert destination. Costs therefore depend on that infrastructure and any external email or messaging service you choose; the cited urlwatch documentation does not establish a universal hosting or delivery price. Reliability also depends on the target site remaining reachable and the scheduler and reporter running successfully. Review logs periodically and keep an alternate way to verify time-sensitive official notices.

Or skip the browser setup

If you need clean visual snapshots of transport notices, ScreenshotNeo is a website screenshot API and MCP server. Its one-request endpoint returns a screenshot or PDF, and its documented parameters can be used with a target URL. For API options and configuration, see the ScreenshotNeo documentation.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

Replace the sample target with the official page you want to capture. ScreenshotNeo removes cookie banners, popups, and chat widgets before the shot. Bot checks, blank pages, and failed loads are never billed; response headers identify the page verdict and whether it was billed. An MCP server lets AI agents use screenshot tools. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000 screenshots. These are visual captures, not change alerts: urlwatch remains the method in this guide for scheduled page-change notifications.

Sign up free for 1,000 screenshots a month, with no card required.

FAQ

Does urlwatch notify me immediately when a railway page changes?

No. It checks when the scheduled process runs, so the next check determines when a change can be noticed.

Can it monitor live train status?

It can compare a page’s retrieved output, but it is not a live train-status service. Use the official NTES enquiry route for running information.

Should I use a browser job for every railway site?

No. Use ordinary URL retrieval when the needed content is in the HTTP response. Choose a browser job only when the relevant content requires JavaScript rendering.

Will a filter keep working after a site redesign?

Not necessarily. Recheck the filtered output after markup changes or when a result unexpectedly becomes empty.

Can I monitor several agencies?

Yes. Add a separately named job for each relevant official page, then choose a schedule and reporter that suit the combined workload.