質問編集履歴
1
質問の修正
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
lambdaで
|
1
|
+
lambdaでchromedriverが読み込めない(127)
|
test
CHANGED
@@ -22,25 +22,23 @@
|
|
22
22
|
|
23
23
|
↓
|
24
24
|
|
25
|
-
上記二つのドライバーに chmod 777 で権限付与
|
25
|
+
解凍し出来た上記二つのドライバーファイルに chmod 777 で権限付与
|
26
26
|
|
27
27
|
↓
|
28
28
|
|
29
|
-
名前「
|
29
|
+
名前「bin」のフォルダを作成し上記二つのドライバーを入れてbin.zip生成
|
30
30
|
|
31
31
|
↓
|
32
32
|
|
33
|
-
|
33
|
+
bin.zipをレイヤーにアップロード
|
34
34
|
|
35
35
|
↓
|
36
36
|
|
37
|
-
pip
|
37
|
+
cloud9でsudo pip install selenium -t ./でseleniumをダウンロードしローカルに落とす
|
38
|
-
|
39
|
-
でseleniumをダウンロード
|
40
38
|
|
41
39
|
↓
|
42
40
|
|
43
|
-
|
41
|
+
落としてきたフォルダをzipに生成
|
44
42
|
|
45
43
|
↓
|
46
44
|
|
@@ -64,13 +62,63 @@
|
|
64
62
|
|
65
63
|
```
|
66
64
|
|
65
|
+
Response
|
66
|
+
|
67
67
|
{
|
68
68
|
|
69
|
-
"errorMessage": "
|
69
|
+
"errorMessage": "Message: Service /opt/bin/chromedriver unexpectedly exited. Status code was: 127\n",
|
70
70
|
|
71
|
-
"errorType": "
|
71
|
+
"errorType": "WebDriverException",
|
72
|
+
|
73
|
+
"stackTrace": [
|
74
|
+
|
75
|
+
" File \"/var/task/lambda_function.py\", line 12, in lambda_handler\n browser = webdriver.Chrome('/opt/bin/chromedriver', chrome_options=options)\n",
|
76
|
+
|
77
|
+
" File \"/opt/python/selenium/webdriver/chrome/webdriver.py\", line 73, in __init__\n self.service.start()\n",
|
78
|
+
|
79
|
+
" File \"/opt/python/selenium/webdriver/common/service.py\", line 98, in start\n self.assert_process_still_running()\n",
|
80
|
+
|
81
|
+
" File \"/opt/python/selenium/webdriver/common/service.py\", line 109, in assert_process_still_running\n raise WebDriverException(\n"
|
82
|
+
|
83
|
+
]
|
72
84
|
|
73
85
|
}
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
Function Logs
|
90
|
+
|
91
|
+
START RequestId: 8bf2d40a-ef24-4cb0-a8d9-0eb18885bd6d Version: $LATEST
|
92
|
+
|
93
|
+
[ERROR] WebDriverException: Message: Service /opt/bin/chromedriver unexpectedly exited. Status code was: 127
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
Traceback (most recent call last):
|
98
|
+
|
99
|
+
File "/var/task/lambda_function.py", line 12, in lambda_handler
|
100
|
+
|
101
|
+
browser = webdriver.Chrome('/opt/bin/chromedriver', chrome_options=options)
|
102
|
+
|
103
|
+
File "/opt/python/selenium/webdriver/chrome/webdriver.py", line 73, in __init__
|
104
|
+
|
105
|
+
self.service.start()
|
106
|
+
|
107
|
+
File "/opt/python/selenium/webdriver/common/service.py", line 98, in start
|
108
|
+
|
109
|
+
self.assert_process_still_running()
|
110
|
+
|
111
|
+
File "/opt/python/selenium/webdriver/common/service.py", line 109, in assert_process_still_running
|
112
|
+
|
113
|
+
raise WebDriverException(END RequestId: 8bf2d40a-ef24-4cb0-a8d9-0eb18885bd6d
|
114
|
+
|
115
|
+
REPORT RequestId: 8bf2d40a-ef24-4cb0-a8d9-0eb18885bd6d Duration: 1149.92 ms Billed Duration: 1150 ms Memory Size: 128 MB Max Memory Used: 59 MB Init Duration: 279.31 ms
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
Request ID
|
120
|
+
|
121
|
+
8bf2d40a-ef24-4cb0-a8d9-0eb18885bd6d
|
74
122
|
|
75
123
|
```
|
76
124
|
|
@@ -92,7 +140,7 @@
|
|
92
140
|
|
93
141
|
options = Options()
|
94
142
|
|
95
|
-
options.binary_location = '/opt/
|
143
|
+
options.binary_location = '/opt/bin/headless-chromium'
|
96
144
|
|
97
145
|
options.add_argument('--headless')
|
98
146
|
|
@@ -104,7 +152,7 @@
|
|
104
152
|
|
105
153
|
|
106
154
|
|
107
|
-
browser = webdriver.Chrome('/opt/
|
155
|
+
browser = webdriver.Chrome('/opt/bin/chromedriver', chrome_options=options)
|
108
156
|
|
109
157
|
browser.get('https://www.google.com')
|
110
158
|
|
@@ -126,6 +174,4 @@
|
|
126
174
|
|
127
175
|
|
128
176
|
|
129
|
-
seleniumのモジュールが見つけられていないようなので生成したzipがおかしい?ような気がするのですが。。
|
130
|
-
|
131
177
|
分かる方おられたご回答よろしくお願いします。
|