![](/img/trans.png)
[英]Python Selenium - [Error 5] Access is denied when trying to quit a browser instance
[英]Error: Unable to move the cache: Access is denied, when using selenium (python)
我正在嘗試使用 selenium(在 Python 中)來抓取網站,但是,當我啟動 chrome web 驅動程序時,它會嘗試加載頁面幾秒鍾,然后關閉 window 並返回以下錯誤消息:
[22424:18188:0531/121110.652:ERROR:cache_util_win.cc(21)] Unable to move the cache: Access is denied. (0x5)
[22424:18188:0531/121110.653:ERROR:cache_util.cc(139)] Unable to move cache folder C:\Users\user\AppData\Local\Google\Chrome\User Data\Profile 1\ShaderCache\GPUCache to C:\Users\user\AppData\Local\Google\Chrome\User Data\Profile 1\ShaderCache\old_GPUCache_000
[22424:18188:0531/121110.653:ERROR:disk_cache.cc(184)] Unable to create cache
[22424:18188:0531/121110.653:ERROR:shader_disk_cache.cc(606)] Shader Cache Creation failed: -2
Opening in existing browser session.
我在加載頁面時使用自定義配置文件。 我的ChromeOptions
看起來像:
OPTIONS = webdriver.ChromeOptions()
OPTIONS.add_argument("--user-data-dir=C:/Users/user/AppData/Local/Google/Chrome/User Data/Profile 1")
driver = webdriver.Chrome(PATH, options=OPTIONS)
# rest of code
聚苯乙烯
1) 我沒有在后台運行任何 Chrome 進程。 不過,我在后台使用 Firefox。
2) 前幾次它工作,它剛剛停止工作。
好像你錯過了番石榴依賴:
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>27.0.1-jre</version>
</dependency>
從任務管理器中關閉所有 Chrome 任務。 主要包括名稱“Google”或“Google Crash handler / reporter”。 它會起作用
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.