kaliiiiiiiiii / Selenium-Driverless

undetected Selenium without usage of chromedriver
https://kaliiiiiiiiii.github.io/Selenium-Driverless/
Other
545 stars 66 forks source link

Directory Clean conditions set wrong #174

Closed UnknownBaronX closed 5 months ago

UnknownBaronX commented 7 months ago

My aim is to remain directories an reuse driver sessions.

Therefore I was creating custom directories:

options = webdriver.ChromeOptions()
options.add_argument(f'--user-data-dir={profile_path}')'
driver = await webdriver.Chrome(options=options)

To remain directories I was using as documented the _cleandirs flag: driver.quit(clean_dirs=False)

Apparently the directories did get cleaned even when setting the flag.

When setting driver option to remain dirs globally it doesnt work either options.auto_clean_dirs = False

Only i combination it remains directories:

options = webdriver.ChromeOptions()
options.add_argument(f'--user-data-dir={profile_path}')'
options.auto_clean_dirs = False
driver = await webdriver.Chrome(options=options)
await driver.get('about:blank')
await driver.quit(clean_dirs=False)
kaliiiiiiiiii commented 7 months ago

thx, will look into

kaliiiiiiiiii commented 7 months ago

Pretty sure that's due to https://github.com/kaliiiiiiiiii/Selenium-Driverless/blob/b39b2550e9baf243ab21eb1f5c7f145a1b233b3b/src/selenium_driverless/webdriver.py#L286-L287

Will be fixed in the next release