How to mute all sounds in chrome webdriver with selenium

后端 未结 3 1268
时光取名叫无心
时光取名叫无心 2021-02-07 00:12

I want to write a script in which I use selenium package like this:

from selenium import webdriver

driver = webdriver.Chrome()
driver.get(\"https://www.youtube.         


        
3条回答
  •  一向
    一向 (楼主)
    2021-02-07 00:21

    For those who are searching for firefox solution this worked for me. I hope it will help others.

    from selenium import webdriver
    profile = webdriver.FirefoxProfile()
    profile.set_preference("media.volume_scale", "0.0")
    driver = webdriver.Firefox(firefox_profile=profile)
    

提交回复
热议问题