Google Calendar Scheduler v3: The Nightmare Dies
Watch the demo video here.
Built using Python 3, and utilizing Selenium Webdriver.
My dream is to one day have a script that automatically detects when my work schedule has been posted, fills in my Google Calendar for me, and then sends my wife and I a text alerting us to its completion. I have broken this up into a three-stage process which I describe in detail here. This is the third installment, and playing off the title of the first portion of this code, we have almost fully automated this nightmare.
This script in particular is designed to handle all the scraping of the shift data located on my work's website. It automatically logs in and navigates to the schedule, just like this script does, then goes on to click all the necessary buttons to actually load Next Week's schedule. Next, it grabs the date for the start of the week, converts it to a datetime.date object, then creates a dictionary from this by adding one day each time. At this point, I have a dictionary where all the dates of the week are keys without values. From here, it then grabs all of the shift data from the table of shifts (using the lxml.html module) and loads it into a separate dictionary in the script (where the keys are simply "Monday", "Tuesday", etc). Finally, it merges the two dictionaries and matches each date with its appropriate list of shift times and prints it to the screen.
With all three stages complete, the final task is to stitch all of these together in order to create a magnificent, and automatic, script that handles everything from start to finish!
EDIT: I did it!