前提・実現したいこと
pythonを使ってスクレイピングするアプリの勉強をしています。chromedriverの設置位置の問題のようで、保存場所を色々と変更して試してみたのですが、エラーがいっこうに解消しません…。
可能性としてありそうなのが、pandasをipythonで起動し、pandas.test()を実行したときに3888件、3件エラーというのがあったのでそれかな?と思いつつ、pandasを削除し再度インストールし直してもエラーが解消されず、stackoverflowなどを見ていると、とりあえず無視してもよさそう?な感じがしたので、ひとまず放置して作業をしております。
pythonは開発環境の構築自体色々と難しそうなので、どこかで間違えている可能性もあるのかと、anacondaを再インストールしたり、pycharmを入れてみたりしても解消されず、原因がまったくわからず途方に暮れております…
default.csvは、pytohnファイルのところに置いています。
下記サイトなども参考にして修正しているのですが、改善されていません…
https://carlos10.hatenablog.com/entry/2019/04/03/041107
発生している問題・エラーメッセージ
FileNotFoundError Traceback (most recent call last) /anaconda3/lib/python3.7/site-packages/selenium/webdriver/common/service.py in start(self) 75 stderr=self.log_file, ---> 76 stdin=PIPE) 77 except TypeError: /anaconda3/lib/python3.7/subprocess.py in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors, text) 774 errread, errwrite, --> 775 restore_signals, start_new_session) 776 except: /anaconda3/lib/python3.7/subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, start_new_session) 1521 err_msg += ': ' + repr(err_filename) -> 1522 raise child_exception_type(errno_num, err_msg, err_filename) 1523 raise child_exception_type(err_msg) FileNotFoundError: [Errno 2] No such file or directory: '/anaconda3/lib/python3.7/site-packages/selenium/webdriver/common/chromedriver.exe': '/anaconda3/lib/python3.7/site-packages/selenium/webdriver/common/chromedriver.exe' During handling of the above exception, another exception occurred: WebDriverException Traceback (most recent call last) <ipython-input-3-68ab631be6d6> in <module> ----> 1 browser = webdriver.Chrome(executable_path='/anaconda3/lib/python3.7/site-packages/selenium/webdriver/common/chromedriver.exe') 2 df = pandas.read_csv('/Users/kenji1/avdes/default.csv', index_col=0) 3 url = "http://wav.tv/actresses/" /anaconda3/lib/python3.7/site-packages/selenium/webdriver/chrome/webdriver.py in __init__(self, executable_path, port, options, service_args, desired_capabilities, service_log_path, chrome_options, keep_alive) 71 service_args=service_args, 72 log_path=service_log_path) ---> 73 self.service.start() 74 75 try: /anaconda3/lib/python3.7/site-packages/selenium/webdriver/common/service.py in start(self) 81 raise WebDriverException( 82 "'%s' executable needs to be in PATH. %s" % ( ---> 83 os.path.basename(self.path), self.start_error_message) 84 ) 85 elif err.errno == errno.EACCES: WebDriverException: Message: 'chromedriver.exe' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
該当のソースコード
python3.7
1from selenium import webdriver 2import pandas 3 4browser = webdriver.Chrome(executable_path='/anaconda3/lib/python3.7/site-packages/selenium/webdriver/common/chromedriver.exe') 5df = pandas.read_csv('/Users/kenji1/avdes/default.csv', index_col=0) #女優名・女優の画像URLが列に入っている 6url = "http://wav.tv/actresses/"
試したこと
anacondaの再インストール
selenium+chromedriverのディレクトリ位置の移動 下記指定の中やpythonファイルと同じところなど
/anaconda3/lib/python3.7/site-packages/selenium/webdriver/common/
補足情報(FW/ツールのバージョンなど)
macOS Mojyava10.14.5
anaconda
python3.7
GoogleChrome バージョン: 74.0.3729.169
ChromeDriver 75.0.3770.90
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/06/21 01:09