GithubHelp home page GithubHelp logo

lambda-web-scrapper's Introduction

AWS Lambda Web Scrapper

This web scrapper runs on AWS with a headless Chromium browser and Puppeteer.

Development Setup

  • install Node.js 8.10 because this is the version being used by the Serverless service

  • install yarn from https://yarnpkg.com

  • install dependencies via yarn install

  • install serverless globally via yarn global add serverless

Run (Local)

  • run the service via yarn serve

Deploy (Production)

  • deploy the Serverless service via yarn deploy

  • note down the created API-key from the deployment output

Usage (Production)

The actualy endpoint URL is displayed in the deployment output. It looks like https://<Gateway ID>.execute-api.eu-central-1.amazonaws.com/prod/scrape.

In order to ensure only authorized clients can call this API, an API-key is needed for the call. This key needs to get specified in the HTTP Request Header for x-api-key.

An exemplary call of the endpoint would look like the following one.

Content of request.json

{
	"url": "https://www.sfit.services",
	"xpathes": [
		"//*/div/div/div/a",
		"//*/div/div/div"
	],
	"uniqueResults": true
}

curl -X POST -H "x-api-key: API-SECRET-KEY" -d @request.json https://GATEWAY-ID.execute-api.eu-central-1.amazonaws.com/prod/scrape

Request Options

The request options get handed in as JSON-data. This data need to adhere the following structure.

  • url: [string] The URL which should get scrapped

  • xpathes: [array of strings] A list of XPathes of which the content should get retrieved

  • uniqueResults (optional): [boolean] When set to true, only unique results will get returned

lambda-web-scrapper's People

Contributors

fschaeffler avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.