jeudi 24 juin 2021

Python script that notifies me when there's an available train seat

I am trying to write a python script that allows me to see if any of the sold-out train tickets are back available (that is when someone decides to return their ticket.). I am planning to take a similar approach to this solution: https://itnext.io/how-i-got-tickets-to-a-quickly-sold-out-brandon-sanderson-lecture-with-40-lines-of-python-code-64c672f6e000.

In this tutorial, the guy notes that the website is "static" which makes it easier for him to track any change in the website. However, the site I am trying to access apparently hides the "true" URL when I search for a trip, which makes my case a bit more complex: https://ebilet.tcddtasimacilik.gov.tr/view/eybis/tnmGenel/tcddWebContent.jsf. And the URL I am redirected to when I search for a trip: https://ebilet.tcddtasimacilik.gov.tr/view/eybis/tnmGenel/int_sat_001.jsf does not send me to the intended page.

My question is how can I obtain the actual URL for these pages and track, for instance, changes in the trip at June 28, 10:20 AM from Izmit to Ankara so I get notified whenever the number of available seats is updated? I'd like to note that the website I am trying to track is a government website. Should I approach my problem similar to the tutorial, or is this not possible in the first place? Does it make sense to attempt to do this with Python? Do you have any recommendations to a fellow beginner on where to get started? Thank you.




Aucun commentaire:

Enregistrer un commentaire