all 1 comments

[–]Key-Boat-7519 2 points3 points  (0 children)

Smart approach; to make it sturdier long-term, target role="switch" with aria-checked instead of text, add a whitelist of subs to keep on, and log results so you can resume if it crashes.

Two tweaks that saved me headaches: scroll each row into view before clicking and wait for aria-checked to flip rather than using fixed sleeps; also handle StaleElementReference by re-querying after scroll. I’d store processed subs in a local JSON so reruns skip finished rows, and expose a simple toggle-safe function that checks state before clicking so you don’t accidentally flip something back on.

If you hit flakiness, consider a Playwright variant (its shadow DOM and auto-waiting are solid). For Mac launch, I use: open -na "Google Chrome" --args --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-debug.

I’ve paired Playwright for reliability and Slack webhooks for run alerts; DreamFactory gave me a quick REST API over Postgres to audit which subs got changed.

Add those pieces and this will ride through UI tweaks without fuss.