Automating Google Calendar Screenshots with Playwright, rclone, and systemd
I wanted a daily visual record of my Google Calendar: not a list of events exported through an API, but an image of the calendar as it looked on a given day. Taking and uploading screenshots manually was repetitive, so I built a small workflow on Ubuntu that captures a rolling seven-day view and stores each image in Google Drive. The implementation combines Python and Playwright for browser…
The author sought a daily visual record of their Google Calendar, not an exported list of events. Capturing screenshots manually was repetitive, so they created a workflow on Ubuntu. The workflow combines Python and Playwright for browser automation, rclone for uploading to Google Drive, and systemd for scheduling. The basic pipeline worked, but authentication proved to be the most challenging aspect.
The source material details the architecture, including the use of Python/Playwright, a headless Google Chrome with a dedicated, authenticated profile, and the Google Calendar website for capturing the rolling seven-day view. The capture process relies on the Google Calendar interface and the browser's saved display settings.
The environment and dependencies used were Ubuntu 22.04, Playwright 1.48.0 with an installed Google Chrome, and a Python virtual environment. The setup includes installing Playwright's Chromium dependencies and launching a dedicated Chrome session for a persistent browser profile.
The author addressed the authentication issue by manually signing in to Google Chrome and creating a persistent browser profile. The automation script then uses this profile to navigate to the Google Calendar website, capture the view, and create a PNG file. The filename follows a date-based naming convention, and the screenshot captures the current webpage at the time of capture. The same workflow can be run multiple times, but it only replaces the existing file for the same day.
After capturing the screenshot, the workflow uses rclone to upload the PNG file to a Google Drive folder named GoogleCalendarScreenshots. The author emphasizes that the captured screenshots are snapshots at the capture time and do not provide a way to reconstruct earlier calendar states. The example screenshot in the repository uses a separate demonstration calendar with fictional events.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.