liunx 谷歌浏览器清空缓存命令
时间: 2023-02-26 18:39:12 浏览: 88
在 Linux 上,可以使用命令行工具 "rm" 来清除 Google Chrome 浏览器的缓存。具体命令如下:
```
rm -rf ~/.cache/google-chrome/
```
请注意,这将删除所有 Chrome 的缓存,包括历史记录、Cookies 和其他数据。请慎重使用。
相关问题
python selenium清理Linux谷歌浏览器缓存
在 Linux 上清理谷歌浏览器缓存,可以使用类似于以下的代码:
```python
from selenium.webdriver.chrome.options import Options
from selenium import webdriver
options = Options()
options.add_argument("--disable-extensions")
options.add_argument("--disable-gpu")
options.add_argument("--headless")
options.add_argument("--no-sandbox")
options.add_argument("--disable-dev-shm-usage")
options.add_argument("--disable-browser-side-navigation")
options.add_argument("--disable-infobars")
options.add_argument("--ignore-certificate-errors")
options.add_argument("--disable-popup-blocking")
options.add_argument("--remote-debugging-port=9222")
options.add_argument("--user-data-dir=/path/to/user/data/dir")
prefs = {"profile.managed_default_content_settings.images": 2}
options.add_experimental_option("prefs", prefs)
driver = webdriver.Chrome(options=options)
# 清理浏览器缓存
driver.delete_all_cookies()
driver.execute_script("window.open('chrome://settings/clearBrowserData');")
driver.switch_to.window(driver.window_handles[-1])
driver.find_element_by_css_selector('* /deep/ #clearBrowsingDataConfirm').click()
driver.switch_to.window(driver.window_handles[0])
driver.quit()
```
这里的关键是使用 `--remote-debugging-port` 参数和 `--user-data-dir` 参数指定一个用户数据目录,然后使用 Selenium 连接到 Chrome 远程调试端口进行清理缓存操作。
需要注意的是,Linux 上可能需要安装 Chrome 或者 Chromium,以及对应的驱动程序。同时,也可以根据需要修改其他的设置和选项。
Linux命令卸载谷歌浏览器
回答: 要在Linux上卸载谷歌浏览器,你可以使用以下命令:
```
sudo yum remove google-chrome-stable
```
这个命令会卸载谷歌浏览器的稳定版本。如果你安装的是其他版本,可以将命令中的"google-chrome-stable"替换为相应的版本名称。
#### 引用[.reference_title]
- *1* [linux系统安装和卸载google浏览器](https://blog.csdn.net/weixin_39524147/article/details/116667943)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [CentOS 7 卸载自带的火狐浏览器,安装谷歌浏览器](https://blog.csdn.net/D_lunar/article/details/126585853)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]