You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -11,10 +11,6 @@ The function interacts with [headless Chromium](https://chromium.googlesource.co
11
11
12
12
Since this Lambda function is written using node.js, you can run almost any script written for [selenium-webdriver](https://www.npmjs.com/package/selenium-webdriver). Example scripts can be found in the `examples` directory.
13
13
14
-
## Installation
15
-
16
-
> If you don't want to build the archive, you can also download a pre-built AWS Lambda *.zip that you can upload directly to a new `node6.10` runtime function using the AWS CLI or Console with at least 256mb of memory. Visit [lambdium releases](https://github.com/smithclay/lambdium/releases).
17
-
18
14
#### Requirements
19
15
20
16
* An AWS Account
@@ -33,6 +29,8 @@ The headless chromium binary is too large for Github, you need to fetch it using
33
29
34
30
#### Running locally with SAM Local
35
31
32
+
SAM Local can run this function on your computer inside a Docker container that acts like AWS Lambda. To run the function with an example event trigger that uses selenium to use headless chromium to visit `google.com`, run this:
33
+
36
34
```sh
37
35
$ sam local invoke Lambdium -e event.json
38
36
```
@@ -65,6 +63,8 @@ Then, run:
65
63
$ modclean --patterns="default:*"
66
64
```
67
65
66
+
Follow the prompts and choose 'Y' to remove extraneous files from `node_modules`.
67
+
68
68
##### Packaging the function for Cloudformation using SAM
69
69
70
70
```sh
@@ -85,7 +85,7 @@ If set, the optional `DEBUG_ENV` environment variable will log additional inform
85
85
86
86
Post-deploy, you can have lambda run a Webdriver script. There's an example of a selenium-webdriver simple script in the `examples/` directory that the Lambda function can now run.
87
87
88
-
Expected JSON input for the function is: `{"Base64Script": "<Base64 Encoding of Selenium Script>"}` (this can also be provided as an environment variable named `BASE64_SCRIPT`).
88
+
Expected JSON input for the function event trigger is: `{"Base64Script": "<Base64 Encoding of Selenium Script>"}` (this can also be provided as an environment variable named `BASE64_SCRIPT`).
89
89
90
90
To run the example Selenium script, you can use the example with the AWS CLI in the `scripts` directory. It takes care of base64 encoding the file and assumes the function name is `lambdium` running in `us-west-2`:
0 commit comments