Vanilla JS Scraper avatar
Vanilla JS Scraper

Pricing

Pay per usage

Go to Store
Vanilla JS Scraper

Vanilla JS Scraper

Developed by

Matthias Stephens

Matthias Stephens

Maintained by Community

Scrape the web using familiar JavaScript methods! Crawls websites using raw HTTP requests, parses the HTML with the JSDOM package, and extracts data from the pages using Node.js code. Supports both recursive crawling and lists of URLs. This actor is a non jQuery alternative to CheerioScraper.

0.0 (0)

Pricing

Pay per usage

4

Total users

460

Monthly users

14

Runs succeeded

>99%

Last modified

2 years ago

You can access the Vanilla JS Scraper programmatically from your own applications by using the Apify API. You can also choose the language preference from below. To use the Apify API, you’ll need an Apify account and your API token, found in Integrations settings in Apify Console.

$echo '{
< "requests": [
< {
< "url": "https://apify.com"
< }
< ],
< "pseudoUrls": [
< {
< "purl": "https://apify.com[(/[\\\\w-]+)?]"
< }
< ],
< "linkSelector": "a[href]",
< "pageFunction": "async function pageFunction(context) {\\n const { window, document, crawler, enqueueRequest, request, response, userData, json, body, kvStore, customData } = context;\\n\\n const title = document.querySelector('\''title'\'').textContent\\n\\n const responseHeaders = response.headers\\n\\n return {\\n title,\\n responseHeaders\\n };\\n}",
< "preNavigationHooks": "// We need to return array of (possibly async) functions here.\\n// The functions accept two arguments: the \\"crawlingContext\\" object\\n// and \\"requestAsBrowserOptions\\" which are passed to the `requestAsBrowser()`\\n// function the crawler calls to navigate..\\n[\\n async (crawlingContext, requestAsBrowserOptions) => {\\n // ...\\n }\\n]",
< "postNavigationHooks": "// We need to return array of (possibly async) functions here.\\n// The functions accept a single argument: the \\"crawlingContext\\" object.\\n[\\n async (crawlingContext) => {\\n // ...\\n },\\n]",
< "proxy": {
< "useApifyProxy": true
< },
< "additionalMimeTypes": [],
< "customData": {}
<}' |
<apify call mstephen190/vanilla-js-scraper --silent --output-dataset

Vanilla JS Scraper API through CLI

The Apify CLI is the official tool that allows you to use Vanilla JS Scraper locally, providing convenience functions and automatic retries on errors.

Install the Apify CLI

$npm i -g apify-cli
$apify login

Other API clients include: