質問編集履歴

2

delete

2018/03/09 07:49

投稿

scraping0101
scraping0101

スコア8

test CHANGED
File without changes
test CHANGED
File without changes

1

記事を消します。

2018/03/09 07:49

投稿

scraping0101
scraping0101

スコア8

test CHANGED
@@ -1 +1 @@
1
- AWS CLOUD9への『chromedriver』の導入方法について
1
+ 削除済み削除済み削除済み
test CHANGED
@@ -1,24 +1,6 @@
1
1
  ### 前提・実現したいこと
2
2
 
3
3
 
4
-
5
- AWS CLOUD9
6
-
7
- python3.6
8
-
9
- にてスクレイピングのスクリプトを動かしてます。
10
-
11
-
12
-
13
- seleniumにてchromeをヘッドレスで動かしたいのですが
14
-
15
- chromedriverの導入がうまくいかず、下記のエラーが出ます。
16
-
17
-
18
-
19
- chromedriverがうまく設置できてないことが問題かと思います。
20
-
21
- 解決方法についてご教示ください。
22
4
 
23
5
 
24
6
 
@@ -28,82 +10,10 @@
28
10
 
29
11
  ```
30
12
 
31
- Traceback (most recent call last):
32
-
33
- File "/home/xxxx/environment/xxxx.py", line 13, in <module>
34
-
35
- browser = webdriver.Chrome(executable_path='/home/xxxx/environment/chromedriver')
36
-
37
- File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/chrome/webdriver.py", line 68, in __init__
38
-
39
- self.service.start()
40
-
41
- File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 98, in start
42
-
43
- self.assert_process_still_running()
44
-
45
- File "/usr/local/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 111, in assert_process_still_running
46
-
47
- % (self.path, return_code)
48
-
49
- selenium.common.exceptions.WebDriverException: Message: Service /home/ec2-user/environment/chromedriver unexpectedly exited. Status code was: 127
50
-
51
-
52
-
53
13
 
54
14
 
55
15
  ### 該当のソースコード
56
16
 
57
- import requests
58
-
59
- import sys
60
-
61
- import types
62
-
63
- import time
64
-
65
-
66
-
67
- from selenium import webdriver
68
-
69
- from selenium.webdriver.common.keys import Keys
70
-
71
- from selenium.webdriver.chrome.options import Options
72
-
73
-
74
-
75
- browser = webdriver.Chrome(executable_path='/home/xxxx/environment/chromedriver')
76
-
77
- options = Options()
78
-
79
- options.add_argument('--headless')
80
-
81
- browser = webdriver.Chrome(chrome_options=options)
82
-
83
- (後略)
84
-
85
17
 
86
18
 
87
19
  ### 試したこと
88
-
89
- selenium (3.8.1)
90
-
91
- chromedriver (2.24.1)
92
-
93
- はpip installにてインストール済み。
94
-
95
-
96
-
97
- また、chromedriverを下記URLからDL
98
-
99
- /home/xxxx/environment/chromedriverに配置済み。
100
-
101
-
102
-
103
- https://sites.google.com/a/chromium.org/chromedriver/downloads
104
-
105
-
106
-
107
-
108
-
109
- なお、macのローカル環境では問題なく動きます。(cloud9上ではエラーが出ます)