Boring technical question which neither the documentation nor ChatGPT can answer.
I want to automate screenshots using #Python's #Selenium Webdriver with #Chrome.
This works - but the non-logged in experience of Twitter forces dark-mode.
I want a light-mode screenshot.
I can't find a way to set SEC-CH-PREFERS-COLOR-SCHEME in Selenium. Nor can I find a light-mode toggle for non-logged in Twitter users.
Any clues gang?
(I want to automate replacing my Twitter embeds with a screenshot.)
Aha! There's a way to cheat!
The old Twitter embed API lets you manually specify colour scheme - and is easy to screenshot.
For example: https://platform.twitter.com/embed/Tweet.html?dnt=true&embedId=twitter-widget-0&frame=false&hideCard=false&hideThread=true&id=1420704988825800704&lang=en&theme=light&width=550px
Hopefully I can replace all the Twitter embeds on my website with images (and, yes, I will add alt text).
Thanks @samir for giving me the inspiration.