2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

スクレイピングのエラー(FileNotFoundError: [WinError 2] 指定されたファイルが見つかりません。)対応

Posted at

Pythonで実装したスクレイピングプログラムを実行した際に、
FileNotFoundError: [WinError 2] 指定されたファイルが見つかりません。
のエラーが出た際のエラー対応についてまとめました。

環境
OS Windows 11
Anaconda 2023-09のバージョン
Python 3.11.5

今回の背景
①プロジェクトメンバー1名にPythonで実装したスクレイピングツールを実行すると上記のエラーが発生した。
②他のメンバーの方は問題なくスクレイピングツールが実行でき、処理が正常終了した。

処理結果の画像
Qiita.jpg

私が実践したこと
(1)pythonのパッケージツールであるpipのインストールlistを取得して頂いた。
(2)正常に実行できている私のpipのインストールlistとWinMergeアプリケーションで比較
(3)エラーが出たメンバーとseleniumライブラリのバージョンを合わせる。
(4)スクレイピングツールを実行し、エラーが再現できた。

エラーが出ないように以下の作業を実施

1. 以下のコマンドを実行する

pip install -U selenium

2 以下のコマンドを実行し、seleniumのバージョンを確認する。

pip list | findstr selenium

2のコマンドの結果

Qiita3.jpg

原因

seleniumライブラリのver3.141.0のバグが原因でした。
Qiita2.jpg

2
3
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
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?