我谷歌版本
下载的版本
python3版本 3.11
selenium
试试这样写:
加入 add_experimental_option('detach', True)配置项,设置网页加载完成后不关闭浏览器
settings = webdriver.ChromeOptions()
settings.add_experimental_option('detach', True)
driver=webdriver.Chrome(options = settings)
driver.get("https://www.baidu.com")
Selenium会等待页面加载完成,然后程序就会自动结束。
可以尝试在后面接着写,进行别的操作,如果正常,那就可以正常使用。