![audioswitcher chrome audioswitcher chrome](https://11.cdn.ekm.net/ekmps/shops/ashdown/images/g-h-cc5b-standard-plate-polished-chrome-1-gang-intermediate-rocker-light-switch-4359-p.jpg)
Video.addEventListener('loadstart', listener)
![audioswitcher chrome audioswitcher chrome](https://www.long-mcquade.com/files/78072/lg_595efd3ef68ebf687f88b6ee92100320.jpg)
Video = wait.until(EC.visibility_of_element_located((By.TAG_NAME, 'video')))Ĭallback = arguments To summarize – complete implementation: from import Byįrom import WebDriverWaitįrom import expected_conditions as EC
![audioswitcher chrome audioswitcher chrome](https://d1aeri3ty3izns.cloudfront.net/media/16/168937/1200/preview.jpg)
time.sleep() would not be the best way to do it – a better way is to subscribe to the loadstart media event – the Python implementation can be found here. You might need to add some delay before that to let the video be initialized before muting it. Or, you can mute the HTML5 video player directly: video = driver.find_element_by_css_selector("video")ĭriver.execute_script("arguments.muted = true ", video) You can change the site access permission, and add as many sites as you’d like: Alternatively, you can set it to On Click, which will disable permissions until you click the icon in the menubar. Scroll down to AudioPick and select Details. Not sure if you can, generally for any page, do it after you have opened the page, but you can mute all the sound for the entire duration of the browser session by setting the -mute-audio switcher: from selenium import webdriverĬhrome_options = webdriver.ChromeOptions()Ĭhrome_options.add_argument("-mute-audio")ĭriver = webdriver.Chrome(chrome_options=chrome_options) Click the menu icon in the top right corner, and select More Tools > Extensions. Is it possible with any other Webdrivers? like Firefox or …? Now after getting the desired URL I want to mute the chrome sounds. I want to write a script in which I use selenium package like this: from selenium import webdriver