英文:
Have WebDriverManager Download to Specific Directory
问题
我理解以下这行代码会将最新的chromedriver文件放置在~/.cache/selenium...
WebDriverManager.chromedriver().setup();
我的问题是:是否有一种方法可以配置它将文件下载到特定的目录?
举个例子,假设我有一个名为"MyChromeDriver"的目录。我希望WebDriverManager将chromedriver文件放在"MyChromeDriver"目录中,而不带所有额外的子目录。
提前感谢!
英文:
I understand that the following line of code places the latest chromedriver file in ~/.cache/selenium...
WebDriverManager.chromedriver().setup();
My question: Is there a way to configure this to download the file to a specific directory?
As an example, say I have a directory named "MyChromeDriver". I would like WebDriverManager to place the chromedriver file inside "MyChromeDriver" without all the extra sub-directories.
Thank you in advance!
答案1
得分: 1
Sure, here's the translated content:
调用WebDriverManager的方法如下:
WebDriverManager.chromedriver().cachePath("MyChromeDriver").avoidOutputTree().setup();
英文:
Invoke WebDriverManager as follows:
WebDriverManager.chromedriver().cachePath("MyChromeDriver").avoidOutputTree().setup();
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论