Skip to content
Advertisement

How to deal with google chrome confirmation alerts when using selenium in python?

I am trying to make a web automation program that opens my school’s app. Our school is using Adobe Connect. When I try to open the installed app, it gives me a confirmation alert. Which is not inspectable and can’t define any XPath or… So, how can I handle this? I have read many QAs but I can’t manage it. Here is my code:

JavaScript

And here is the solution I tested from other questions but not worked(attach it at the end of the code above):

JavaScript

The error message:

JavaScript

I also added the confirmation alert, for your ease.

enter image description here

Advertisement

Answer

I’m not sure if you can set apps to automatically open in the browser prefs or not, but you could always take a cropped screeshot of the button “Open Adobe Connect” and then use pyautogui to locate it and click it:

JavaScript

Pyautogui sendkeys could work too I’d imagine.

Advertisement