Puppeteer Improved Inputs Scraper avatar
Puppeteer Improved Inputs Scraper
Deprecated
View all Actors
This Actor is deprecated

This Actor is unavailable because the developer has decided to deprecate it. Would you like to try a similar Actor instead?

See alternative Actors
Puppeteer Improved Inputs Scraper

Puppeteer Improved Inputs Scraper

barry8schneider/puppeteer20191228

Add the following options to inputs: Use Live View, Inject Query, and Inject Underscore

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://apify.com"
13        }
14    ],
15    "pseudoUrls": [
16        {
17            "purl": "https://apify.com[(/[\\w-]+)?]"
18        }
19    ],
20    "linkSelector": "a",
21    "proxyConfiguration": {
22        "useApifyProxy": false
23    },
24    "customData": {},
25    "pageFunction": async function pageFunction(context) {
26        const { page, request, log } = context;
27        const title = await page.title();
28        log.info(`URL: ${request.url} TITLE: ${title}`);
29        return {
30            url: request.url,
31            title
32        };
33    },
34    "preGotoFunction": async function preGotoFunction({ request, page, Apify }) {
35        /* add your pre-navigation logic here, if needed */
36    },
37    "initialCookies": [],
38    "waitUntil": [
39        "networkidle2"
40    ]
41};
42
43(async () => {
44    // Run the Actor and wait for it to finish
45    const run = await client.actor("barry8schneider/puppeteer20191228").call(input);
46
47    // Fetch and print Actor results from the run's dataset (if any)
48    console.log('Results from dataset');
49    const { items } = await client.dataset(run.defaultDatasetId).listItems();
50    items.forEach((item) => {
51        console.dir(item);
52    });
53})();
Developer
Maintained by Community
Categories