只要加上 import requests,谷歌浏览器一运行完程序,即使不使用关闭命令,也会自动关闭浏览器,只要去掉导入此模块就不会自动关闭,是什么原因?
import requests
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
option=Options()
option.add_argument('--disable-blink-features=AutomationControlled')
web=webdriver.Chrome(options=option)
web.implicitly_wait(8)
web.get("https://www.baidu.com")
chrome_options = Options()
chrome_options.add_experimental_option("detach", True)
你要是不想退也可以加个这也行
不管有么有requests 都不会关闭你试试