How to make Python visible to headless (headless) browsers… here is a solution to the problem.
How to make Python visible to headless (headless) browsers
I created a headless webdriver chrome browser by setting this parameter:
chrome_options.add_argument("--headless")
Then open the browser with the following command:
driver = webdriver. Chrome(executable_path=os.path.abspath("chromedriver"), chrome_options=chrome_options)
Is it possible to make the browser appear after the conditions are met? I tried removing the property again using :
chrome_options.arguments.remove("--headless")
But that didn’t do anything.
Solution
When you pass the –headless parameter to chrome, it actually creates the instance as headless (headless
), instead of creating a window and hiding it, if you want to show the instance when the condition is met, you must consider not using –headless in the chrome parameter.