Context: I’m in the US and need a DMV appointment to reinstate my driver’s license. Unfortunately, due to the… poorly executed roll out of “Real ID”, a new requirement for photo IDs such as Driver’s Licenses, so does everyone else in my state (though for different reasons) I want to write a bot in Python, or maybe TypeScript, that will use Selenium to do what my coworker told me worked for him to get a DMV appointment: check every night/morning exactly at midnight for an appointment anywhere, then periodically check for a closer and sooner appointment from people canceling. As far as I can tell this will involve solving multiple smaller problems:
- Actually driving the browser to get the data for available appointments.
- Ranking appointments based on desirability (distance and lead time)
- Actually making the appointment, as well as canceling appointments we no longer need to be nice
How would y’all approach this? I have never done anything like this before myself and I know what tools I might use but I am curious what y’all would do.
I would be careful because automating requests to a government website can be illegal.
That said, I think you really just need to monitor the HTTP requests such as GET and POST when you do it manually and then mimic those requests on a timed schedule. Actually parsing the information from the page is going to be highly specific to the DMV webapp in question.
This is one of those tasks where you spend weeks automating it to save yourself 15 minutes one time.