Extended GPT Scraper avatar
Extended GPT Scraper
Try for free

No credit card required

View all Actors
Extended GPT Scraper

Extended GPT Scraper

drobnikj/extended-gpt-scraper
Try for free

No credit card required

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