如何允许或拒绝通知地理位置麦克风摄像头弹出 [英] How to allow or deny notification geo-location microphone camera pop up
本文介绍了如何允许或拒绝通知地理位置麦克风摄像头弹出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我无法单击访问摄像机身份验证的允许按钮.
I'm not able to click on Allow button of access camera authentication pop up.
这是弹出的外观.
推荐答案
向 Allow
或 Block
通知 Microphone
使用 Selenium
进行strong>, Camera
, GeoLocation
, Notification
访问,您必须使用ChromeOptions
类,如下所示:
To Allow
or Block
the notification of Microphone
, Camera
, GeoLocation
, Notification
access using Selenium
you have to use ChromeOptions
Class as follows :
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
opt = Options()
opt.add_argument("--disable-infobars")
opt.add_argument("start-maximized")
opt.add_argument("--disable-extensions")
# Pass the argument 1 to allow and 2 to block
opt.add_experimental_option("prefs", { \
"profile.default_content_setting_values.media_stream_mic": 1,
"profile.default_content_setting_values.media_stream_camera": 1,
"profile.default_content_setting_values.geolocation": 1,
"profile.default_content_setting_values.notifications": 1
})
driver = webdriver.Chrome(chrome_options=opt, executable_path=r'C:\Utility\BrowserDrivers\chromedriver.exe')
driver.get('https://www.google.co.in')
print("Page Title is : %s" %driver.title)
driver.quit()
这篇关于如何允许或拒绝通知地理位置麦克风摄像头弹出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文