Hide browser bot during code execution display at end selenium VBA

Viewed 408

I am trying to find a way that enables me to hide the driver (bot) of the selenium in VBA during the execution of the code and display it at end I can hide it using this line

bot.AddArgument "--headless"

But how I restore it?

1 Answers

No, it won't be possible to make Chrome operate initially in headless mode and then switch back to normal mode within the same session.

When you configure an instance of a WebDriver with Options() to span a new Browsing Context the configuration gets baked within the driver executable which will persist for the lifetime of the WebDriver and being uneditable. So you can't modify/add any existing/new configuration through Options() class to the WebDriver instance which is currently in execution.

Even if you are able to extract the Driver and Session attributes e.g. Session ID, Cookies, UserAgent and other session attributes from the already initiated Driver and Browsing Session still you won't be able to change the set of attributes of the Driver.
You can find more details in these discussions:

Credits to undetected Selenium

Related