Web Scraper Experimental Debug avatar
Web Scraper Experimental Debug
Try for free

No credit card required

View all Actors
Web Scraper Experimental Debug

Web Scraper Experimental Debug

mtrunkat/web-scraper-experimental-dbgr
Try for free

No credit card required

Experimental version of Apify Web Scraper with Chrome debugger integrated

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

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://apify.com" }],
9    "pseudoUrls": [{ "purl": "https://apify.com[(/[\\w-]+)?]" }],
10    "linkSelector": "a",
11    "pageFunction": """async function pageFunction(context) {
12    // See README for context properties. If the syntax is unfamiliar see the link
13    // https://javascript.info/destructuring-assignment#object-destructuring
14    const { request, log, jQuery } = context;
15
16    // To be able to use jQuery as $, one needs save it into a variable
17    // and select the inject jQuery option. We've selected it for you.
18    const $ = jQuery;
19    const title = $('title').text();
20
21    // This is yet another new feature of Javascript called template strings.
22    // https://javascript.info/string#quotes
23    log.info(`URL: ${request.url} TITLE: ${title}`);
24
25    // To save data just return an object with the requested properties.
26    return {
27        url: request.url,
28        title
29    };
30}""",
31    "proxyConfiguration": { "useApifyProxy": False },
32    "initialCookies": [],
33    "waitUntil": ["networkidle2"],
34    "customData": {},
35}
36
37# Run the Actor and wait for it to finish
38run = client.actor("mtrunkat/web-scraper-experimental-dbgr").call(run_input=run_input)
39
40# Fetch and print Actor results from the run's dataset (if there are any)
41for item in client.dataset(run["defaultDatasetId"]).iterate_items():
42    print(item)
Developer
Maintained by Community
Actor metrics
  • 3 monthly users
  • 86.2% runs succeeded
  • 0.0 days response time
  • Created in Oct 2019
  • Modified about 3 years ago