Website Content Crawler avatar
Website Content Crawler
Try for free

No credit card required

View all Actors
Website Content Crawler

Website Content Crawler

apify/website-content-crawler
Try for free

No credit card required

Automatically crawl and extract text content from websites with documentation, knowledge bases, help centers, or blogs. This Actor is designed to provide data to feed, fine-tune, or train large language models such as ChatGPT or LLaMA.

The code examples below show how to run the Actor and get its results. To run the code, you need to have an Apify account. Replace <YOUR_API_TOKEN> in the code with your API token, which you can find under Settings > Integrations in Apify Console. Learn mode

Node.js

Python

curl

1import { ApifyClient } from 'apify-client';
2
3// Initialize the ApifyClient with your Apify API token
4const client = new ApifyClient({
5    token: '<YOUR_API_TOKEN>',
6});
7
8// Prepare Actor input
9const input = {
10    "startUrls": [
11        {
12            "url": "https://docs.apify.com/academy/web-scraping-for-beginners"
13        }
14    ],
15    "includeUrlGlobs": [],
16    "excludeUrlGlobs": [],
17    "initialCookies": [],
18    "proxyConfiguration": {
19        "useApifyProxy": true
20    },
21    "removeElementsCssSelector": "nav, footer, script, style, noscript, svg,\n[role=\"alert\"],\n[role=\"banner\"],\n[role=\"dialog\"],\n[role=\"alertdialog\"],\n[role=\"region\"][aria-label*=\"skip\" i],\n[aria-modal=\"true\"]",
22    "clickElementsCssSelector": "[aria-expanded=\"false\"]"
23};
24
25(async () => {
26    // Run the Actor and wait for it to finish
27    const run = await client.actor("apify/website-content-crawler").call(input);
28
29    // Fetch and print Actor results from the run's dataset (if any)
30    console.log('Results from dataset');
31    const { items } = await client.dataset(run.defaultDatasetId).listItems();
32    items.forEach((item) => {
33        console.dir(item);
34    });
35})();
Developer
Maintained by Apify
Actor metrics
  • 2k monthly users
  • 99.7% runs succeeded
  • 2.9 days response time
  • Created in Mar 2023
  • Modified 10 days ago