How to keep the “headless” option after driver.close() - Selenium/ Python

懵懂的女人 提交于 2019-12-23 05:14:12

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!