Terence Eden on Nostr: Boring technical question which neither the documentation nor ChatGPT can answer. I ...
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.)
Published at
2024-08-07 09:50:53Event JSON
{
"id": "0d394a8d925b94a81af1c4cc6b7ca5011833fa7603f01259c605fa55ac3d731f",
"pubkey": "fddf487eea9db57a6e320f80e5cb63de50bedf539695a41c0d447be6c23643e1",
"created_at": 1723024253,
"kind": 1,
"tags": [
[
"t",
"python"
],
[
"t",
"selenium"
],
[
"t",
"chrome"
],
[
"proxy",
"https://mastodon.social/users/Edent/statuses/112920117482971203",
"activitypub"
]
],
"content": "Boring technical question which neither the documentation nor ChatGPT can answer.\n\nI want to automate screenshots using #Python's #Selenium Webdriver with #Chrome. \n\nThis works - but the non-logged in experience of Twitter forces dark-mode.\n\nI want a light-mode screenshot.\n\nI 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.\n\nAny clues gang?\n\n(I want to automate replacing my Twitter embeds with a screenshot.)",
"sig": "1fb988b4ab0dcb12b3fcfc90f3e26a6ab056e42f7faec13b5fb16c44dc5f19f60761923a40fc191fd35928a0456f2a6c0a44051bd444ea4fb6677134a23ef562"
}