SergeyPirogov / webdriver_manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can .install() take a path?

notionparallax opened this issue · comments

commented

Hi, I work in a pretty locked down environment, would it be possible to add an arg to install so that I can make it install in the project folder? E.g.:

driver = webdriver.Chrome(ChromeDriverManager().install(path="."))

or something like that?

driver_cache_manager = DriverCacheManager(root_dir=‘your project path’)
ChromeDriverManager(cache_manager=driver_cache_manager).install()

Wont fix

commented

Hi, Sorry it took me so long to get back to this, it takes a long time to get my environment updated (it's a long, and very sad story). With v4, this works great for me:

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
from webdriver_manager.core.driver_cache import DriverCacheManager


def main():
    """Let's Go!"""
    driver_cache_manager = DriverCacheManager(root_dir="testing")
    service = Service(ChromeDriverManager(cache_manager=driver_cache_manager).install())
    driver = webdriver.Chrome(service=service)
    driver.implicitly_wait(10)
    driver.get("https://github.com/SergeyPirogov/webdriver_manager/issues/620")
    driver.close()


if __name__ == "__main__":
    main()

Is there somewhere in the docs that you'd like me to make a PR with some extras to document this?