Fast Scraper avatar

Fast Scraper

Try Actor

$5.00/month

View all Actors
Fast Scraper

Fast Scraper

danielherman/fast-scraper
Try Actor

$5.00/month

Fast Scraper is a blazingly fast web scraper powered by Rust on the backend. It allows you to scrape static HTML pages extremely quickly while using only <128 MB of memory. With this scraper, you can maximize the efficiency of your credits on Apify.

You can access the Fast Scraper programmatically from your own JavaScript 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.

1import { ApifyClient } from 'apify-client';
2
3// Initialize the ApifyClient with your Apify API token
4// Replace the '<YOUR_API_TOKEN>' with your token
5const client = new ApifyClient({
6    token: '<YOUR_API_TOKEN>',
7});
8
9// Prepare Actor input
10const input = {
11    "requests": [
12        {
13            "url": "https://www.scrapethissite.com/pages/simple/"
14        },
15        {
16            "id": "forms",
17            "url": "https://www.scrapethissite.com/pages/simple/",
18            "extract": [
19                {
20                    "field_name": "extracted_html",
21                    "selector": "#countries > div > div:nth-child(4) > div:nth-child(1)",
22                    "extract_type": "HTML"
23                }
24            ]
25        },
26        {
27            "id": "hockey",
28            "url": "https://www.scrapethissite.com/pages/forms/",
29            "extract": [
30                {
31                    "field_name": "year1",
32                    "selector": "#hockey > div > table > tbody > tr:nth-child(2) > td.year",
33                    "extract_type": "Text"
34                },
35                {
36                    "field_name": "year2",
37                    "selector": "#hockey > div > table > tbody > tr:nth-child(3) > td.year",
38                    "extract_type": "Text"
39                },
40                {
41                    "field_name": "class_name",
42                    "selector": "#hockey > div > table > tbody > tr:nth-child(2) > td.year",
43                    "extract_type": {
44                        "Attribute": "class"
45                    }
46                }
47            ]
48        }
49    ],
50    "proxy_settings": {
51        "useApifyProxy": true
52    }
53};
54
55// Run the Actor and wait for it to finish
56const run = await client.actor("danielherman/fast-scraper").call(input);
57
58// Fetch and print Actor results from the run's dataset (if any)
59console.log('Results from dataset');
60console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
61const { items } = await client.dataset(run.defaultDatasetId).listItems();
62items.forEach((item) => {
63    console.dir(item);
64});
65
66// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

Fast Scraper API in JavaScript

The Apify API client for JavaScript is the official library that allows you to use Fast Scraper API in JavaScript or TypeScript, providing convenience functions and automatic retries on errors.

Install the apify-client

npm install apify-client

Other API clients include:

Developer
Maintained by Community

Actor Metrics

  • 1 monthly user

  • 0 No stars yet

  • >99% runs succeeded

  • Created in Jun 2024

  • Modified 5 months ago

Categories