im trying to open this page in dark mode, using selenium and python. however anything i try doesnt seem to work. this is the code i believe should work:
options = webdriver.ChromeOptions()
options.headless = False
options.add_argument('--force-dark-mode')
driver = webdriver.Chrome(options=options)
link = "https://www.reddit.com"
driver.get(link)
a similar question was asked here but doesnt work.
also i have looked at the command switches , and it doesnt work for me.
I do see it is working, the driver browser is opened in the dark mode.
This is my code:
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
options = Options()
options.add_argument('--force-dark-mode')
s = Service('C:\webdrivers\chromedriver.exe')
driver = webdriver.Chrome(options=options, service=s)
url = 'https://www.reddit.com'
driver.get(url)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.