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

1from apify_client import ApifyClient
2
3# Initialize the ApifyClient with your Apify API token
4client = ApifyClient("<YOUR_API_TOKEN>")
5
6# Prepare the Actor input
7run_input = {
8    "startUrls": [{ "url": "https://news.ycombinator.com/" }],
9    "instructions": """Gets the post with the most points from the page and returns it as JSON in this format: 
10postTitle
11postUrl
12pointsCount""",
13    "model": "gpt-3.5-turbo",
14    "includeUrlGlobs": [],
15    "excludeUrlGlobs": [],
16    "linkSelector": "a[href]",
17    "initialCookies": [],
18    "proxyConfiguration": { "useApifyProxy": True },
19    "targetSelector": "",
20    "removeElementsCssSelector": "script, style, noscript, path, svg, xlink",
21    "skipGptGlobs": [],
22    "schema": {
23        "type": "object",
24        "properties": {
25            "title": {
26                "type": "string",
27                "description": "Page title",
28            },
29            "description": {
30                "type": "string",
31                "description": "Page description",
32            },
33        },
34        "required": [
35            "title",
36            "description",
37        ],
38    },
39    "schemaDescription": "",
40}
41
42# Run the Actor and wait for it to finish
43run = client.actor("drobnikj/extended-gpt-scraper").call(run_input=run_input)
44
45# Fetch and print Actor results from the run's dataset (if there are any)
46print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
47for item in client.dataset(run["defaultDatasetId"]).iterate_items():
48    print(item)
49
50# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start
Developer
Maintained by Apify
Actor metrics
  • 83 monthly users
  • 21 stars
  • 98.8% runs succeeded
  • 1.4 days response time
  • Created in Jun 2023
  • Modified 2 months ago