Fetching Train availability in IRCTC
Problem
When you search for trains in irctc page, it never shows the seat availability directly. You’ll have to manually go and click the refresh button of every listed train
List of trains, but availability is not present
Steps to fix
-
Search for trains in https://www.irctc.co.in
-
Apply filters to narrow down the list of trains
Narrow down list of trains using filters
- Paste the following script in console to get the availability status of all trains at once
document.querySelectorAll('.fa.fa-repeat').forEach(el=>el.click())
- The end. Tada!
Note:
Ensure that you always try this out after narrowing down the list using filters. Else it’ll be too many requests going on at once.