LoginSignup
6
4

SeleniumとChromeDriverManagerについて(備忘録)

Posted at

Seleniumでexecutable_pathが廃止されたことで


webdriver.Chrome(ChromeDriverManager.install(), options=options)

という今までの書き方ができなくなりました。

この書き方をすると


TypeError: __init__() got multiple values for argument 'options'

というエラーがでます。

対処法は


service = Service(executable_path=ChromeDriverManager().install())
webdriver.Chrome(options=options, service=service)

です。

参考資料

seleniumドキュメント
selenium github コミットログ
Selenium4 WebDriver の executable_path 使用に伴う警告の回避方法
6
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
4