Trainline Scraper
Spider read thetrainline.com in 129 ms without a browser and returned 99 lines of clean markdown, including the section "You + us = ❤️".
Questions? Contact our English speaking Customer Support via e-mail or phone.## You + us = ❤️Don’t just take it from us. Check out what our users have to say.## Download the app that thinks for you. Join 40 million people on Trainline.* on the [ App Store ](<https://2n8w.app.link?~campaign=Web--Trainline&~channel=W2A&~feature=HomeAppsDownload&~placement=US Homepage&~tags=locale=en_US&~tags=version=1&~tags=target=ios&$ios_url=https://itunes.apple.com/US/app/thetrainline/id334235181&$ios_deepview=false&$ios_passive_deepview=false&$fallback_url=https://itunes.apple.com/US/app/thetrainline/id334235181&$deeplink_path=com.thetrainline>)* on [ Google Play ](<https://2n8w.app.link?~campaign=Web--Trainline&~channel=W2A&~feature=HomeAppsDownload&~placement=US Homepage&~tags=locale=en_US&~tags=version=1&~tags=target=androidos&$android_url=https://play.google.com/store/apps/details?id=com.thetrainline&hl=en-US&$android_deepview=false&$android_passive_deepview=false&$fallback_url=https://play.google.com/store/apps/details?id=com.thetrainline&hl=en-US&$deeplink_path=com.thetrainline>)* 🔔Get real-time trip notification* 📱Manage booking from your phone](<https://2n8w.app.link?~campaign=Web--Trainline&~channel=W2A&~feature=HomeAppsDownload&~placement=US Homepage&~tags=locale=en_US&~tags=version=1&~tags=target=ios&$ios_url=https://itunes.apple.com/US/app/thetrainline/id334235181&$ios_deepview=false&$ios_passive_deepview=false&$fallback_url=https://itunes.apple.com/US/app/thetrainline/id334235181&$deeplink_path=com.thetrainline>)[ The same call, in code.
The capture above came back as markdown. These examples add a key, so you get browser rendering, proxies, and concurrency on thetrainline.com.
import { SpiderBrowser } from "spider-browser";
const spider = new SpiderBrowser({
apiKey: process.env.SPIDER_API_KEY!,
});
await spider.connect();
const page = spider.page!;
await page.goto("https://www.thetrainline.com/book/results?journeySearchType=single&origin=urn%3Atrainline%3Ageneric%3Aloc%3A5696&destination=urn%3Atrainline%3Ageneric%3Aloc%3A4916&outwardDate=2026-07-01T09%3A00%3A00");
// No selectors, no schema. Spider reads the page and names the fields.
const data = await page.scrape();
console.log(data);
await spider.close(); import { SpiderBrowser } from "spider-browser";
const spider = new SpiderBrowser({
apiKey: process.env.SPIDER_API_KEY!,
stealth: 2,
});
await spider.connect();
const page = spider.page!;
await page.goto("https://www.thetrainline.com/book/results?journeySearchType=single&origin=urn%3Atrainline%3Ageneric%3Aloc%3A5696&destination=urn%3Atrainline%3Ageneric%3Aloc%3A4916&outwardDate=2026-07-01T09%3A00%3A00");
await page.content(12000);
const data = await page.evaluate(`(() => {
const journeys = [];
document.querySelectorAll("[data-testid='journey-option']").forEach(el => {
const departure = el.querySelector("[data-testid='departure-time']")?.textContent?.trim();
const arrival = el.querySelector("[data-testid='arrival-time']")?.textContent?.trim();
const duration = el.querySelector("[data-testid='journey-duration']")?.textContent?.trim();
const price = el.querySelector("[data-testid='journey-price']")?.textContent?.trim();
const operator = el.querySelector("[data-testid='operator-name']")?.textContent?.trim();
if (departure) journeys.push({ departure, arrival, duration, price, operator });
});
return JSON.stringify({ total: journeys.length, journeys: journeys.slice(0, 10) });
})()`);
console.log(JSON.parse(data));
await spider.close(); Ready for volume? Get an API key →
Fields you can pull.
Spider names these from the page. The capture above came back as markdown; the same
call with return_format: "json" returns them as keys.
What thetrainline.com costs to scrape.
The capture above cost $0.000766 to fetch. Pricing is $1 per GB of pre-transformation bandwidth plus $0.001 per CPU minute, so a page like this one lands at a fraction of a cent. Failed requests are billed at $0.
- Free balance on signup
- No card required to test
- Balance never expires
Run it keyless, no account
More Travel scrapers.
Expedia Scraper
Extract travel deals, hotel listings, flight prices, and booking data from Expedia.
Airbnb Scraper
Extract Airbnb listings, pricing, host info, reviews, and availability from search results.
TripAdvisor Scraper
Extract hotel reviews, restaurant ratings, attraction data, and traveler photos from TripAdvisor.
Start scraping thetrainline.com.
You already have the call. A key raises the rate limit and turns on browser rendering, proxies, and concurrency. Balance never expires, and top-ups go through secure checkout.