Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
错误:无法移动缓存:使用selenium(python)时拒绝访问_Python_Selenium_Selenium Webdriver_Caching - Fatal编程技术网

错误:无法移动缓存:使用selenium(python)时拒绝访问

错误:无法移动缓存:使用selenium(python)时拒绝访问,python,selenium,selenium-webdriver,caching,Python,Selenium,Selenium Webdriver,Caching,我正在尝试使用selenium(Python)来抓取网站,但是,当我启动chrome web驱动程序时,它会尝试加载页面几秒钟,然后关闭窗口并返回以下错误消息: [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

我正在尝试使用selenium(Python)来抓取网站,但是,当我启动chrome web驱动程序时,它会尝试加载页面几秒钟,然后关闭窗口并返回以下错误消息:

[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>

番石榴
番石榴
27.0.1-jre

您似乎缺少了番石榴的依赖性:

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>27.0.1-jre</version>
        </dependency>

番石榴
番石榴
27.0.1-jre

ChromeOptions没有错误。那么问题出在哪里?需要查看完整代码可能是因为您打开了其他Chrome窗口。尝试关闭并重试。ChromeOptions没有错误。那么问题是什么?需要查看完整代码可能是因为您打开了其他Chrome窗口。尝试关闭它们,然后重试。