create webdriver folder if not exists.

master
Max 2023-08-02 11:00:09 +08:00 committed by GitHub
parent 6958685b1a
commit 264bb34137
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -414,6 +414,9 @@ def load_chromdriver_normal(config_dict, driver_type):
webdriver_path = os.path.join(Root_Dir, "webdriver")
chromedriver_path = get_chromedriver_path(webdriver_path)
if not os.path.exists(webdriver_path):
os.mkdir(webdriver_path)
if not os.path.exists(chromedriver_path):
print("WebDriver not exist, try to download...")
chromedriver_autoinstaller.install(path="webdriver", make_version_dir=False)
@ -521,6 +524,9 @@ def load_chromdriver_uc(config_dict):
webdriver_path = os.path.join(Root_Dir, "webdriver")
chromedriver_path = get_chromedriver_path(webdriver_path)
if not os.path.exists(webdriver_path):
os.mkdir(webdriver_path)
if not os.path.exists(chromedriver_path):
print("WebDriver not exist, try to download...")
chromedriver_autoinstaller.install(path="webdriver", make_version_dir=False)