Interesting that you should mention the trainline.com - the website (and subsequently the call centre application) actually used screenscraping itself in the early days, to read the availability for a journey from the venerable CRS (reservations service) that was hosted by (then) SEMA, but dated back to the BRBS (British Rail Business Systems) days.
It (CRS) should have been superseded by now with the new Reservations Service, so I imagine there's now an API for handling these requests from thetrainline.com (and other sites) now!
SD