1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "zipcode": "80335",
12 "keywords": [
13 "tasche",
14 "handcreme",
15 "haarspray"
16 ],
17 "maxItems": 20,
18 "endPage": 1,
19 "startUrls": [
20 "https://www.dm.de/balea-gesichtshaarentferner-p4067796182026.html",
21 "https://www.dm.de/pflege-und-parfum",
22 "https://www.dm.de/pflege-und-parfum?allCategories.id0=020000&pageSize0=10&sort0=editorial_relevance¤tPage0=2",
23 "https://www.dm.de/search?query=tasche&searchProviderType=dm-products",
24 "https://www.dm.de/search?query=tasche&searchProviderType=dm-products¤tPage=1&loadPrev=false"
25 ],
26 "customMapFunction": (object) => { return {...object} },
27 "proxy": {
28 "useApifyProxy": true
29 }
30};
31
32
33const run = await client.actor("epctex/dm-scraper").call(input);
34
35
36console.log('Results from dataset');
37console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
38const { items } = await client.dataset(run.defaultDatasetId).listItems();
39items.forEach((item) => {
40 console.dir(item);
41});
42
43