Skip to content

Commit 5764274

Browse files
authored
update readme.md
1 parent dc5251c commit 5764274

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ The function interacts with [headless Chromium](https://chromium.googlesource.co
1111

1212
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.
1313

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-
1814
#### Requirements
1915

2016
* An AWS Account
@@ -33,6 +29,8 @@ The headless chromium binary is too large for Github, you need to fetch it using
3329

3430
#### Running locally with SAM Local
3531

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+
3634
```sh
3735
$ sam local invoke Lambdium -e event.json
3836
```
@@ -65,6 +63,8 @@ Then, run:
6563
$ modclean --patterns="default:*"
6664
```
6765

66+
Follow the prompts and choose 'Y' to remove extraneous files from `node_modules`.
67+
6868
##### Packaging the function for Cloudformation using SAM
6969

7070
```sh
@@ -85,7 +85,7 @@ If set, the optional `DEBUG_ENV` environment variable will log additional inform
8585
8686
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.
8787
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`).
8989
9090
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`:
9191

0 commit comments

Comments
 (0)