GPT Scraper avatar
GPT Scraper
Try for free

Pay $9.00 for 1,000 pages

View all Actors
GPT Scraper

GPT Scraper

drobnikj/gpt-scraper
Try for free

Pay $9.00 for 1,000 pages

Extract data from any website and feed it into GPT via the OpenAI API. Use ChatGPT to proofread content, analyze sentiment, summarize reviews, extract contact details, and much more.

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 more

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://news.ycombinator.com/"
13        }
14    ],
15    "instructions": "Gets the post with the most points from the page and returns it as JSON in this format: \npostTitle\npostUrl\npointsCount",
16    "includeUrlGlobs": [],
17    "excludeUrlGlobs": [],
18    "linkSelector": "a[href]",
19    "initialCookies": [],
20    "proxyConfiguration": {
21        "useApifyProxy": true
22    },
23    "targetSelector": "",
24    "removeElementsCssSelector": "script, style, noscript, path, svg, xlink",
25    "schema": {
26        "type": "object",
27        "properties": {
28            "title": {
29                "type": "string",
30                "description": "Page title"
31            },
32            "description": {
33                "type": "string",
34                "description": "Page description"
35            }
36        },
37        "required": [
38            "title",
39            "description"
40        ]
41    },
42    "schemaDescription": ""
43};
44
45(async () => {
46    // Run the Actor and wait for it to finish
47    const run = await client.actor("drobnikj/gpt-scraper").call(input);
48
49    // Fetch and print Actor results from the run's dataset (if any)
50    console.log('Results from dataset');
51    console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
52    const { items } = await client.dataset(run.defaultDatasetId).listItems();
53    items.forEach((item) => {
54        console.dir(item);
55    });
56})();
57
58// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs
Developer
Maintained by Apify
Actor metrics
  • 323 monthly users
  • 97.8% runs succeeded
  • 9.8 days response time
  • Created in Mar 2023
  • Modified 17 days ago