1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "search",
12 "searchTerm": "notebook",
13 "brands": [],
14 "urls": [
15 "https://www.mediamarkt.de/de/search.html?query=samsung%20galaxy%20s24",
16 "https://www.mediamarkt.de/de/search.html?query=samsung%20galaxy%20s24&page=2",
17 "https://www.mediamarkt.de/de/search.html?query=samsung%20galaxy%20s24&sort=price",
18 "https://www.mediamarkt.de/de/search.html?query=notebook",
19 "https://www.mediamarkt.de/de/category/laptops-notebooks-362.html",
20 "https://www.mediamarkt.de/de/category/laptops-notebooks-362.html?page=2",
21 "https://www.mediamarkt.de/de/category/laptops-notebooks-362.html?sort=price&brand=APPLE",
22 "https://www.mediamarkt.de/de/category/c-362.html",
23 "https://www.mediamarkt.de/de/product/_hp-omen-17-db1351ng-173-zoll-amd-ryzentm-ai-5-340-16-gb-1-tb-nvidia-geforce-rtxtm-5060-windows-11-home-3008418.html",
24 "https://www.mediamarkt.de/de/product/_p-3008418.html",
25 "https://www.mediamarkt.de/de/search.html?query=iphone&brand=APPLE",
26 "https://mediamarkt.de/de/category/laptops-notebooks-362.html",
27 "https://www.mediamarkt.de/de/category/laptops-notebooks-362.html?searchParams=%2FSearch.ff%3Fquery%3Dnotebook"
28 ],
29 "proxy": {
30 "useApifyProxy": true,
31 "apifyProxyGroups": [
32 "RESIDENTIAL"
33 ],
34 "apifyProxyCountry": "DE"
35 },
36 "ignoreFieldsForChanges": []
37};
38
39
40const run = await client.actor("abotapi/mediamarkt-de-scraper").call(input);
41
42
43console.log('Results from dataset');
44console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
45const { items } = await client.dataset(run.defaultDatasetId).listItems();
46items.forEach((item) => {
47 console.dir(item);
48});
49
50