Skip to content

Add way to set custom folder for storing web drivers (Eg. chromedriver, uc_driver) #3859

Closed
@mdmintz

Description

@mdmintz

Add way to set custom folder for storing web drivers (Eg. chromedriver, uc_driver)


Currenly, the default folder for storing web drivers is the seleniumbase/drivers folder from the location where the seleniumbase Python package is installed.

I'm going to add a way to modify the storage location like this:

from seleniumbase.core import browser_launcher
browser_launcher.override_driver_dir("./temp")

Those lines could be added to an __init__.py file to affect the driver location for all scripts.
Or those lines could be added directly into a SeleniumBase script itself near the top of the file.
(That'll work as long as the call happens before the driver is downloaded, once this ticket is done.)

If the driver folder is set to one that doesn't already exist, it'll print an error message similar to this:

* Warning: Cannot set driver_dir to nonexistent directory:
~/github/SeleniumBase/examples/cdp_mode/temp
* Will use the default folder instead:
~/github/SeleniumBase/seleniumbase/drivers

Therefore, if people want to set a custom driver dir, they should make sure the folder already exists.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions