-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EES-4444 Use webdriver-manager for Chromedriver downloads
This replaces Pyderman, which currently doesn't support Chrome 115+ due to recent changes in how Chrome versions are published. See: - SergeyPirogov/webdriver_manager#580 - shadowmoose/pyderman#35
- Loading branch information
Showing
6 changed files
with
72 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,16 @@ | ||
import os | ||
import platform | ||
from pathlib import Path | ||
from typing import Optional | ||
|
||
import pyderman | ||
from webdriver_manager.chrome import ChromeDriverManager | ||
|
||
|
||
def get_webdriver(version: str) -> None: | ||
chromedriver_filename = "chromedriver.exe" if platform.system() == "Windows" else "chromedriver" | ||
pyderman.install( | ||
file_directory="./webdriver/", | ||
filename=chromedriver_filename, | ||
verbose=True, | ||
chmod=True, | ||
overwrite=False, | ||
version=version, | ||
) | ||
def get_webdriver(version: Optional[str] = None) -> None: | ||
driver_path = ChromeDriverManager(driver_version=version).install() | ||
driver_dir = Path(driver_path).parents[0] | ||
|
||
os.environ["PATH"] += os.pathsep + str(Path("./webdriver").absolute()) | ||
os.environ["PATH"] += os.pathsep + str(driver_dir) | ||
|
||
|
||
if __name__ == "__main__": | ||
get_webdriver("latest") | ||
get_webdriver() |