質問編集履歴
1
誤字
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,2 +1,59 @@
|
|
1
|
-
homebrewからchromedriverをインストールし、下
|
2
|
-
|
1
|
+
homebrewからchromedriverをインストールし、下のようにコードを書いたのですが、browser = webdriver.Chrome() のところでエラーが出てしまいました。考えらる原因はなんでしょうか?よろしくお願いします。
|
2
|
+
|
3
|
+
!pip install selenium
|
4
|
+
|
5
|
+
!pip install beautifulsoup4
|
6
|
+
|
7
|
+
from selenium import webdriver
|
8
|
+
|
9
|
+
import time
|
10
|
+
import pandas as bd
|
11
|
+
|
12
|
+
USER = "test_user"
|
13
|
+
PASS = "test_pw"
|
14
|
+
|
15
|
+
browser = webdriver.Chrome()
|
16
|
+
browser.implicitly_wait(5)**
|
17
|
+
#エラー箇所
|
18
|
+
---------------------------------------------------------------------------
|
19
|
+
WebDriverException Traceback (most recent call last)
|
20
|
+
<ipython-input-5-a95e7033a7bf> in <module>
|
21
|
+
----> 1 browser = webdriver.Chrome()
|
22
|
+
2 browser.implicitly_wait(5)
|
23
|
+
|
24
|
+
~/opt/anaconda3/lib/python3.8/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)
|
25
|
+
74
|
26
|
+
75 try:
|
27
|
+
---> 76 RemoteWebDriver.__init__(
|
28
|
+
77 self,
|
29
|
+
78 command_executor=ChromeRemoteConnection(
|
30
|
+
|
31
|
+
~/opt/anaconda3/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py in __init__(self, command_executor, desired_capabilities, browser_profile, proxy, keep_alive, file_detector, options)
|
32
|
+
155 warnings.warn("Please use FirefoxOptions to set browser profile",
|
33
|
+
156 DeprecationWarning, stacklevel=2)
|
34
|
+
--> 157 self.start_session(capabilities, browser_profile)
|
35
|
+
158 self._switch_to = SwitchTo(self)
|
36
|
+
159 self._mobile = Mobile(self)
|
37
|
+
|
38
|
+
~/opt/anaconda3/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py in start_session(self, capabilities, browser_profile)
|
39
|
+
250 parameters = {"capabilities": w3c_caps,
|
40
|
+
251 "desiredCapabilities": capabilities}
|
41
|
+
--> 252 response = self.execute(Command.NEW_SESSION, parameters)
|
42
|
+
253 if 'sessionId' not in response:
|
43
|
+
254 response = response['value']
|
44
|
+
|
45
|
+
~/opt/anaconda3/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py in execute(self, driver_command, params)
|
46
|
+
319 response = self.command_executor.execute(driver_command, params)
|
47
|
+
320 if response:
|
48
|
+
--> 321 self.error_handler.check_response(response)
|
49
|
+
322 response['value'] = self._unwrap_value(
|
50
|
+
323 response.get('value', None))
|
51
|
+
|
52
|
+
~/opt/anaconda3/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py in check_response(self, response)
|
53
|
+
240 alert_text = value['alert'].get('text')
|
54
|
+
241 raise exception_class(message, screen, stacktrace, alert_text)
|
55
|
+
--> 242 raise exception_class(message, screen, stacktrace)
|
56
|
+
243
|
57
|
+
244 def _value_or_default(self, obj, key, default):
|
58
|
+
|
59
|
+
WebDriverException: Message: unknown error: cannot find Chrome binary
|