webdriver-managerで躓いたのでメモ。
問題
====== WebDriver manager ======
Could not get version for google-chrome with the command: powershell "$ErrorActionPreference='silentlycontinue' ; (Get-Item -Path "$env:PROGRAMFILES\Google\Chrome\Application\chrome.exe").VersionInfo.FileVersion ; if (-not $? -or $? -match $error) { (Get-Item -Path "$env:PROGRAMFILES(x86)\Google\Chrome\Application\chrome.exe").VersionInfo.FileVersion } if (-not $? -or $? -match $error) { (Get-Item -Path "$env:LOCALAPPDATA\Google\Chrome\Application\chrome.exe").VersionInfo.FileVersion } if (-not $? -or $? -match $error) { reg query "HKCU\SOFTWARE\Google\Chrome\BLBeacon" /v version } if (-not $? -or $? -match $error) { reg query "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome" /v version }"
Current google-chrome version is UNKNOWN
Get LATEST chromedriver version for UNKNOWN google-chrome
Trying to download new driver from https://chromedriver.storage.googleapis.com/99.0.4844.51/chromedriver_win32.zip
- PowerShellの実行結果
> (Get-Item -Path "$env:PROGRAMFILES\Google\Chrome\Application\chrome.exe").VersionInfo.FileVersion ;
Get-Item : パス 'C:\Program Files\Google\Chrome\Application\chrome.exe' が存在しないため検出できません。
解決策
- webdriver-managerのバージョンを3.5.3から3.2.2へダウングレード
https://stackoverflow.com/questions/71223000/could-not-get-version-for-google-chrome-with-the-command-powershell-erroracti
https://github.com/SergeyPirogov/webdriver_manager/pull/324#issuecomment-1054010544
バージョンの取得方法が変わったようだ。