vba browser driver updater(en)

提供:yonewiki
2025年11月29日 (土) 00:31時点におけるYo-net (トーク | 投稿記録)による版 (→‎Overview)

Return to Language and Development Environment

Overview

https://yonetech-studio.booth.pm/items/7702646


This is a free tool distributed on the BOOTH website above.


It is a small utility that automatically updates the driver files required for browser automation.


This tool was primarily developed to automatically update WebDrivers for SeleniumBasic.


  • Edge drivers are downloaded from the following URL:

https://msedgedriver.microsoft.com/<version>/edgedriver_win64.zip


  • Chrome drivers are downloaded from the following URL:

https://storage.googleapis.com/chrome-for-testing-public/<version>/win64/chromedriver-win64.zip


By default, the drivers are saved in the following folder:

C:\Users\<UserID>\AppData\Local\SeleniumBasic

  • Edge driver:

edgedriver.exe

  • Chrome driver:

chromedriver.exe

The program retrieves the LOCALAPPDATA environment variable (C:\Users\<UserID>\AppData\Local). If a folder named "SeleniumBasic" exists, the driver will be saved there. If the folder does not exist, it will be created automatically.
Copies of the downloaded zip files are saved in the same directory where this program is located (or in the working directory) under the following folders:
  • Edge: edgedriver_temp
  • Chrome: chromedriver_temp
To record that a driver has already been downloaded, empty files of approximately 1 KB are created in the same directory as this program (or in the working directory):
  • Edge: edge_<version>
  • Chrome: chrome_<version>
Deleting these record files will allow the program to download the drivers again. If the record files exist, the driver will not be re-downloaded.

 

オプション引数

プログラムやショートカットリンクを右クリックして表示されるプログラム名の後ろに起動引数を記述することでオプション引数を利用することができます。

  • --browser

更新したいドライバのブラウザについて指定します。edgeと指定するとedge用のドライバーが更新され、chromeと指定するとchrome用のドライバーが更新されます。省略されるとedgeと指定しているのと同じ動作になるので、edgeの場合は指定する必要はありませんが、明記することは自由です。


使用例

vba_browser_driver_updater.exe --browser=chrome


  • --driver-path

ドライバーの保存パスを絶対パスで指定できます。省略すると%LOCALAPPDATA%\SeleniumBasic(具体的には以下のようなパス、C:\Users\ユーザID\AppData\Local\SeleniumBasic)に保存されます。SelenumBasic用のドライバとして使う以外の用途では、利用者が自由にパスを指定できた方が便利だから存在するオプションです。パスをダブルクォーテーションで囲えば、パスの中に空白が使われても問題が発生することなく指定できます。


使用例

vba_browser_driver_updater.exe --browser=chrome --driver-path="C:\WebDriver"


  • --output-filename

ドライバーの保存ファイル名を指定できます。省略するとEdge用にはedgedriver.exe、Chrome用にはchromedriver.exeという名前が使われます。省略時のファイル名はSelenium Basicが要求しているファイル名に合わせています。Edge用の配布時のドライバ名はmsedgedriver.exeなので、この名前を利用したい場合はオプションで指定する必要があります。ファイル名をダブルクォーテーションで囲えば、ファイル名の中に空白が使われても問題が発生することなく指定できます。


使用例

vba_browser_driver_updater.exe --browser=chrome --driver-path="C:\WebDriver" --output-filename=msedgedriver.exe


  • --no-wait

このプログラムが起動されるとコマンドプロンプトが起動しますが、このオプションを指定すると何もキー入力をしなくてもウィンドウが閉じるようになります。ただし起動後の動作内容についての出力を見られないので、どのような動作だったか更新がなかったと判断されたのか?更新動作があったのかを具体的に知ることは出来なくなります。更新時の手数は減りますのでそことのトレードオフが発生します。ここまでのオプションのようにオプション名の後ろに=をつけたり値を指定したりする必要のないオプションになっています。


使用例

vba_browser_driver_updater.exe --browser=chrome --driver-path="C:\WebDriver" --output-filename=msedgedriver.exe --no-wait

 

更新履歴

2025-11-27 Version1.0.0.0 新規リリース

 

関連情報

 

言語と開発環境へ戻る。