path = "C:/Users/Administrator/AppData/Local/Programs/Python/Python36/chromedriver.exe"
opt = webdriver.ChromeOptions()
# 把chrome设置成无界面模式
opt.add_argument('headless')
# 创建chrome无界面对象
driver = webdriver.Chrome(executable_path=path,chrome_options=opt)
网友评论