无法从Google URL下拉chromedriver驱动程序

时间:2019-08-15 18:03:31

标签: java selenium selenium-webdriver selenium-chromedriver webdrivermanager-java

尝试下拉chrome驱动程序时,文件不能位于https://chromedriver.storage.googleapis.com/中。但是,快速搜索显示驱动程序文件实际上在google资源中。

我已经成功使用镜像(http://npm.taobao.org/mirrors/chromedriver)下拉了驱动程序,但是这样做必须与公司的VPN断开连接,所以这不是理想的选择。

无论VPN连接如何,都无法在Google存储库中找到驱动程序。我也尝试过删除arch配置,但是无法让webdrivermanager在google目录中找到驱动程序。

TestNG和Java代码段

    @BeforeClass
    public static void setupClass() throws Exception {    
       WebDriverManager.chromedriver().arch32().setup();
       driver = new ChromeDriver();
    }

这是控制台日志和错误消息:

579 [main] INFO io.github.bonigarcia.wdm.WebDriverManager - Reading https://chromedriver.storage.googleapis.com/ to seek chromedriver
1000 [main] ERROR io.github.bonigarcia.wdm.WebDriverManager - chromedriver 76.0.3809.68 for WIN32 not found in https://chromedriver.storage.googleapis.com/
1000 [main] WARN io.github.bonigarcia.wdm.WebDriverManager - There was an error managing chromedriver 76.0.3809.68 (chromedriver 76.0.3809.68 for WIN32 not found in https://chromedriver.storage.googleapis.com/) ... trying again using cache and mirror
16990 [main] INFO io.github.bonigarcia.wdm.Downloader - Downloading http://npm.taobao.org/mirrors/chromedriver/76.0.3809.68/chromedriver_win32.zip
18134 [main] INFO io.github.bonigarcia.wdm.Downloader - Extracting binary from compressed file chromedriver_win32.zip
18314 [main] INFO io.github.bonigarcia.wdm.WebDriverManager - Exporting webdriver.chrome.driver as C:\Users\me\.m2\repository\webdriver\chromedriver\win32\76.0.3809.68\chromedriver.exe

1 个答案:

答案 0 :(得分:0)

尝试不强制使用体系结构:

WebDriverManager.chromedriver().setup();