问题
After I invoke the
driver.close()
method in selenium, followed by
driver.start_session(capabilities=cap, browser_profile=my_profile)
my browser seems to be unable to keep the "headless" option, precedently configured as
options = Options()
options.headless = True
as I initialized the webdriver.
I even tried to use the
driver.quit()
method and the re-initialize the webdriver, but it seems it easily throws a lot of errors; at least with the project developed as I did till now. If there's a way to inject the headless option in the
driver.start_session()
method I shall be quite happy for real.
Thanks in advance
来源:https://stackoverflow.com/questions/55283460/how-to-keep-the-headless-option-after-driver-close-selenium-python