源码
def close(self):
"""
Closes the current window.
:Usage:
driver.close()
"""
self.execute(Command.CLOSE)
def quit(self):
"""
Quits the driver and closes every associated window.
:Usage:
driver.quit()
"""
try:
self.execute(Command.QUIT)
finally:
self.stop_client()
通过查看源码我们一目了然:close()
方法是指退出当前窗口,quit()
是直接退出浏览器并关闭所有相关窗口。**finally: self.stop_client()**这行代码说明quit()
很硬。