Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: Unable to move the cache: Access is denied, when using selenium (python)

I'm trying to use selenium (in Python) to scrape a website, however, when I start the chrome web driver, it tries to load the page for a few seconds, and then closes the window and returns the following error message:

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

I 'm using a custom profile when loading the page. My ChromeOptions look like:

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

P.S.

1) I don't have any Chrome processes running in the background. I'm using Firefox in the background though.

2) It worked for the first few times, It stopped working just now.

like image 573
Roy Avatar asked Jun 03 '26 22:06

Roy


1 Answers

Close all Chrome Tasks from Task Manager. Mainly including the name "Google" or "Google Crash handler / reporter". It will work

like image 108
Rajesh Kanna Avatar answered Jun 05 '26 12:06

Rajesh Kanna



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!