-1

I open 13 instances of Google Chrome every 30 minutes. After 30 minutes they are getting closed by killing the Chromedriver task through .bat file:

taskkill /F /IM chromedriver.exe /T

And after that I open them again.

Lately, on Chrome version 110 they changed the cache folder from

C:\Users\User\AppData\Local\Temp\*

to:

C:\Program Files (x86)

Every 5 hours there is a lot of cache gathering. In the older version, when the Temp folder was the default, I ran .bat file to delete everything there:

del /Q /S C:\Users\User\AppData\Local\Temp\*

Now, that the Program files is the default, I'm using 'shutil' python library script to delete the specific cache folders:

base_path = r"C:\Program Files (x86)"
dir_list = glob.iglob(os.path.join(base_path, "scoped_dir*"))
for path in dir_list:
    if os.path.isdir(path):
        print(path)
        shutil.rmtree(path, ignore_errors=True)

I have this code on 3 different computers and something really odd is happening. Since this method of deleting the cache files, all my computers are taking something around 40 minutes (really, 40 minutes, not joking) to log in to my windows user (After I'm entering the password to my user after restarting my compter).

Maybe when I deleted the cache with "del /Q /S" there is any registry that collecting on my computer and every Windows startup is taking so long because of that?

Someone can help?

NatiFo
  • 125
  • 1
  • 1
  • 5

1 Answers1

0

All the files of C:\Users\User\AppData\Local\Temp\ are not created/used by ChromeDriver. Within this folder there resides the Diagnostics files as well as the cache files which helps in the startup and enhanced browsing experience in a lot many ways.

At the most you can delete the scoped_dir* directories only, althrough they remains empty if you invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • Thanks you for the answer. I know, there are more folders beside the scoped_dir. The problem is the startup time that caused (I think) because the way I was deleting the scoped_dir files. Is there something check why does the boot taking so long? Or check the registry? – NatiFo Mar 01 '23 at 12:23
  • _Is there something check why does the boot taking so long_: It's a can of worms. This space would be too small for any details :) – undetected Selenium Mar 01 '23 at 12:59
  • what do you mean? – NatiFo Mar 01 '23 at 15:05