How can I close the microphone/camera popup in Python / Selenium?

后端 未结 1 400
难免孤独
难免孤独 2020-12-06 07:59

I want to click block. I tried this:

alert = browser.switch_to_alert()
alert.dismiss();

However it says that there is no alert ope

1条回答
  •  自闭症患者
    2020-12-06 08:37

    To get rid of the Microphone/Camera popup you can use the following arguments from ChromeOptions Class:

    • Java solution:

      ChromeOptions options = new ChromeOptions();
      options.addArguments("allow-file-access-from-files");
      options.addArguments("use-fake-device-for-media-stream");
      options.addArguments("use-fake-ui-for-media-stream"); 
      WebDriver driver = new ChromeDriver(options);
      

    0 讨论(0)
提交回复
热议问题