1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "buildNumbers": [
10 "0.3.67",
11 "canary",
12 ],
13 "actorId": "apify/website-content-crawler",
14 "actorInput": {
15 "maxResults": 1,
16 "blockMedia": True,
17 "clickElementsCssSelector": "[aria-expanded=\"false\"]",
18 "clientSideMinChangePercentage": 15,
19 "crawlerType": "playwright:adaptive",
20 "proxyConfiguration": { "useApifyProxy": True },
21 "readableTextCharThreshold": 100,
22 "removeElementsCssSelector": """nav, footer, script, style, noscript, svg, img[src^='data:'],
23[role=\"alert\"],
24[role=\"banner\"],
25[role=\"dialog\"],
26[role=\"alertdialog\"],
27[role=\"region\"][aria-label*=\"skip\" i],
28[aria-modal=\"true\"]""",
29 "renderingTypeDetectionPercentage": 10,
30 "respectRobotsTxtFile": True,
31 "reuseStoredDetectionResults": False,
32 "signHttpRequests": False,
33 "startUrls": [{ "url": "https://docs.apify.com/academy/scraping-basics-javascript" }],
34 "storeSkippedUrls": False,
35 "useLlmsTxt": False,
36 "useSitemaps": False,
37 "keepUrlFragments": False,
38 "ignoreCanonicalUrl": False,
39 "ignoreHttpsErrors": False,
40 "removeCookieWarnings": True,
41 "expandIframes": True,
42 "aggressivePrune": False,
43 "debugMode": False,
44 "debugLog": False,
45 "saveHtml": False,
46 "saveHtmlAsFile": False,
47 "saveMarkdown": True,
48 "saveFiles": False,
49 "saveScreenshots": False,
50 },
51}
52
53
54run = client.actor("apify/actor-benchmark").call(run_input=run_input)
55
56
57print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
58for item in client.dataset(run["defaultDatasetId"]).iterate_items():
59 print(item)
60
61