python – How to disable the “some site wants to open this application” alert in Chrome using Selenium?

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.

Read more here: Source link