1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "urls": [
12 {
13 "url": "https://www.apify.com/"
14 }
15 ],
16 "format": "png",
17 "quality": 85,
18 "fullPage": true,
19 "device": "custom",
20 "viewportWidth": 1280,
21 "viewportHeight": 1080,
22 "deviceScaleFactor": 1,
23 "colorScheme": "no-preference",
24 "locale": "en-US",
25 "waitUntil": "domcontentloaded",
26 "waitForImages": false,
27 "waitForFonts": true,
28 "delay": 0,
29 "scrollToBottom": false,
30 "maxScrollSteps": 400,
31 "scrollStepPx": 250,
32 "delayAfterScrolling": 0,
33 "waitUntilNetworkIdleAfterScroll": false,
34 "waitUntilNetworkIdleAfterScrollTimeout": 1000,
35 "hideFixedElements": false,
36 "cookieBannerAction": "hide",
37 "pdfPageSize": "web",
38 "pdfLandscape": false,
39 "pdfPrintBackground": true,
40 "pdfFitOnePage": false,
41 "pdfMargin": "none",
42 "maxConcurrency": 1,
43 "maxRetries": 0,
44 "navigationTimeoutSecs": 60,
45 "maxPageHeight": 0
46};
47
48
49const run = await client.actor("nimbryxo-studio/full-page-website-screenshot-and-pdf-capture").call(input);
50
51
52console.log('Results from dataset');
53console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
54const { items } = await client.dataset(run.defaultDatasetId).listItems();
55items.forEach((item) => {
56 console.dir(item);
57});
58
59