最近在研究chrome headless 版本号59+ 但是selenium的webdriver最新版本最高支持chrome58。
driver.close()调试过程出现bug:
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: failed to close window in 20 seconds
(Session info: headless chrome=59.0.3071.86)
(Driver info: chromedriver=2.30.477690 (c53f4ad87510ee97b5c3425a14c0e79780cdf262),platform=Mac OS X 10.11.6 x86_64)
查询close和qiut 的区别:
This is a good question I have seen people use Close() when they shouldn't. I looked in the source code for the Selenium Client & WebDriver C# Bindings and found the following.