selenium 后台运行设置handless模式
测试脚本调试完毕之后,部署到服务器运行,此时,需要将selenium的执行方式,切换为后台运行,也就是无界面运行
chrome_option = webdriver.ChromeOptions()
chrome_option.add_argument('--headless')
chrome_option.add_argument("--window-size=1920,1050") #调节窗口size
self.driver = webdriver.Chrome(options=chrome_option)