240 发简信
IP属地:吉林
  • 最新google chrome 98.0.4758 以上方法失效,使用如下方法加载配置文件:
    #__*__ encoding:utf8 __*__
    from selenium import webdriver
    # from selenium.webdriver.chrome.service import Service
    from selenium.webdriver.chrome.options import Options

    #加载chromedriver参数
    # s = Service(r'D:\chromeDownload\chromedriver_win32\chromedriver.exe')
    #加载chrome网页参数来允许摄像头麦克风
    # chrome_option = webdriver.ChromeOptions()
    # chrome_option.add_argument = {'user-data-dir':r"C:\Users\TAL\AppData\Local\Google\Chrome\User Data\Default"}
    opt = Options()
    opt.add_argument("--disable-infobars")
    opt.add_argument("start-maximized")
    opt.add_argument("--disable-extensions")

    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(options=opt)
    driver.get('https://xxx/index.html')

    selenium通过加载用户配置文件加载摄像头和麦克风

    打开某个网页,已经设置允许摄像头和麦克风了,但通过selenium仍然弹出询问 selenium通过加载用户文件来解决此问题 from selenium import web...

  • 120
    selenium通过加载用户配置文件加载摄像头和麦克风

    打开某个网页,已经设置允许摄像头和麦克风了,但通过selenium仍然弹出询问 selenium通过加载用户文件来解决此问题 from selenium import web...

  • codewar练习--1

    题目:An isogram is a word that has no repeating letters, consecutive or non-consecutive. ...