How to disable the "some site wants to open this application" alert in Chrome using Selenium?


How to block this pop-up?


An English equivalent would be:

This site is trying to open Spotify. wants to open this application.

□ Always allow to open links of this type in the associated app

I tried to use:

options = webdriver.ChromeOptions()
driver = webdriver.Chrome(options=options)
Asked By: ezbooz



When running the Selenium webdriver, Chrome opens a new browsing session with the default Chrome profile (without any custom settings).

To get around this, you can set a profile directory by using the --user-data-dir=/your/profile/data/location argument. In this location Chrome will create a new profile location. When your script is running, manually navigate to the Chrome window that should have opened on your screen and simply enable the always open option.

The next time you run your script using the same profile directory you shouldn’t see this pop-up.

Answered By: Pawel Kam