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": "portatil",
13 "urls": [
14 "https://www.mediamarkt.es/es/category/portatiles-153.html",
15 "https://www.mediamarkt.es/es/category/portatiles-153.html?page=2",
16 "https://www.mediamarkt.es/es/category/c-153.html",
17 "https://www.mediamarkt.es/es/product/_portatil-lenovo-ideapad-slim-3-15arp10-153-wuxga-amd-ryzentm-7-170-16gb-ram-512gb-ssd-radeontm-680m-sin-sistema-operativo-sin-cargador-1625748.html",
18 "https://www.mediamarkt.es/es/product/_p-1625748.html",
19 "https://www.mediamarkt.es/es/search.html?query=portatil",
20 "https://www.mediamarkt.es/es/search.html?query=portatil&page=2"
21 ],
22 "brands": [],
23 "proxy": {
24 "useApifyProxy": true,
25 "apifyProxyGroups": [
26 "RESIDENTIAL"
27 ],
28 "apifyProxyCountry": "ES"
29 },
30 "ignoreFieldsForChanges": []
31};
32
33
34const run = await client.actor("abotapi/mediamarkt-es-scraper").call(input);
35
36
37console.log('Results from dataset');
38console.log(`๐พ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
39const { items } = await client.dataset(run.defaultDatasetId).listItems();
40items.forEach((item) => {
41 console.dir(item);
42});
43
44