質問編集履歴
2
delete
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
1
記事を消します。
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
|
1
|
+
削除済み削除済み削除済み
|
body
CHANGED
@@ -1,55 +1,10 @@
|
|
1
1
|
### 前提・実現したいこと
|
2
2
|
|
3
|
-
AWS CLOUD9
|
4
|
-
python3.6
|
5
|
-
にてスクレイピングのスクリプトを動かしてます。
|
6
3
|
|
7
|
-
seleniumにてchromeをヘッドレスで動かしたいのですが
|
8
|
-
chromedriverの導入がうまくいかず、下記のエラーが出ます。
|
9
|
-
|
10
|
-
chromedriverがうまく設置できてないことが問題かと思います。
|
11
|
-
解決方法についてご教示ください。
|
12
|
-
|
13
4
|
```
|
14
5
|
エラーメッセージ
|
15
6
|
```
|
16
|
-
Traceback (most recent call last):
|
17
|
-
File "/home/xxxx/environment/xxxx.py", line 13, in <module>
|
18
|
-
browser = webdriver.Chrome(executable_path='/home/xxxx/environment/chromedriver')
|
19
|
-
File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/chrome/webdriver.py", line 68, in __init__
|
20
|
-
self.service.start()
|
21
|
-
File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 98, in start
|
22
|
-
self.assert_process_still_running()
|
23
|
-
File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 111, in assert_process_still_running
|
24
|
-
% (self.path, return_code)
|
25
|
-
selenium.common.exceptions.WebDriverException: Message: Service /home/ec2-user/environment/chromedriver unexpectedly exited. Status code was: 127
|
26
7
|
|
27
|
-
|
28
8
|
### 該当のソースコード
|
29
|
-
import requests
|
30
|
-
import sys
|
31
|
-
import types
|
32
|
-
import time
|
33
9
|
|
34
|
-
from selenium import webdriver
|
35
|
-
from selenium.webdriver.common.keys import Keys
|
36
|
-
from selenium.webdriver.chrome.options import Options
|
37
|
-
|
38
|
-
browser = webdriver.Chrome(executable_path='/home/xxxx/environment/chromedriver')
|
39
|
-
options = Options()
|
40
|
-
options.add_argument('--headless')
|
41
|
-
browser = webdriver.Chrome(chrome_options=options)
|
42
|
-
(後略)
|
43
|
-
|
44
|
-
### 試したこと
|
10
|
+
### 試したこと
|
45
|
-
selenium (3.8.1)
|
46
|
-
chromedriver (2.24.1)
|
47
|
-
はpip installにてインストール済み。
|
48
|
-
|
49
|
-
また、chromedriverを下記URLからDL
|
50
|
-
/home/xxxx/environment/chromedriverに配置済み。
|
51
|
-
|
52
|
-
https://sites.google.com/a/chromium.org/chromedriver/downloads
|
53
|
-
|
54
|
-
|
55
|
-
なお、macのローカル環境では問題なく動きます。(cloud9上ではエラーが出ます)
|