前提・実現したいこと
Seleniumを使用してスクレイピングを行いたいたく、
https://qiita.com/wejhhv/items/59d739b40dc6f7f5aabcを参考に
まずはChromeを開こうとしています。
発生している問題・エラーメッセージ
webdriverがどうしても使えません。
エラー6 が何を示しているのか、調べてもわからない状態です
--------------------------------------------------------------------------- WebDriverException Traceback (most recent call last) <ipython-input-11-e6a16c2f4b6d> in <module>() 3 from selenium import webdriver 4 ----> 5 driver = webdriver.Chrome() #WEBブラウザの起動 3 frames /usr/local/lib/python3.7/dist-packages/selenium/webdriver/chrome/webdriver.py in __init__(self, executable_path, port, options, service_args, desired_capabilities, service_log_path, chrome_options, service, keep_alive) 71 port, options, 72 service_args, desired_capabilities, ---> 73 service_log_path, service, keep_alive) /usr/local/lib/python3.7/dist-packages/selenium/webdriver/chromium/webdriver.py in __init__(self, browser_name, vendor_prefix, port, options, service_args, desired_capabilities, service_log_path, service, keep_alive) 88 89 self.service = service ---> 90 self.service.start() 91 92 try: /usr/local/lib/python3.7/dist-packages/selenium/webdriver/common/service.py in start(self) 96 count = 0 97 while True: ---> 98 self.assert_process_still_running() 99 if self.is_connectable(): 100 break /usr/local/lib/python3.7/dist-packages/selenium/webdriver/common/service.py in assert_process_still_running(self) 110 raise WebDriverException( 111 'Service %s unexpectedly exited. Status code was: %s' --> 112 % (self.path, return_code) 113 ) 114 WebDriverException: Message: Service chromedriver unexpectedly exited. Status code was: -6
該当のソースコード
Python
1import time 2import chromedriver_binary 3from selenium import webdriver 4 5driver = webdriver.Chrome() #WEBブラウザの起動 6
試したこと
・Colab上でpipでchromedriver_binary、seleniumをインストール
・パスが通っていないのかと思いターミナルでChromeに合ったバージョンのwebdriverをインストール
(リンク内容の解決策2を実行)
補足情報(FW/ツールのバージョンなど)
実行環境:Mac、Google Colab
バージョン:Google,Googlegriver:96.0.4664.45
回答1件
あなたの回答
tips
プレビュー