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 "searchTerms": [
13 "shirt"
14 ],
15 "urls": [
16 "https://www.target.com.au/search?text=shirt",
17 "https://www.target.com.au/search?text=shirt&page=2",
18 "https://www.target.com.au/search?text=shirt&sortBy=price-asc",
19 "https://target.com.au/search?text=shirt",
20 "https://www.target.com.au/c/baby/sleep/monitors/W118762",
21 "https://www.target.com.au/c/women/jackets-coats/W1507165?page=2",
22 "https://www.target.com.au/p/x/72544778",
23 "https://www.target.com.au/p/anything/W2250321627",
24 "https://www.target.com.au/search?text=shirt&sEngine=c",
25 "https://www.target.com.au/c/women",
26 "https://www.target.com.au/c/women/jackets-coats/W1507165?sortBy=price-asc",
27 "https://www.target.com.au/search?q=shirt&page=1",
28 "https://www.target.com.au/search?text=shirt&q=%3Arelevance%3Abrand%3ATarget",
29 "https://www.target.com.au/p/72544778",
30 "https://www.target.com.au/p/x/72544778?variant=72544779"
31 ],
32 "proxy": {
33 "useApifyProxy": true
34 },
35 "incrementalMode": false,
36 "ignoreFieldsForChanges": []
37};
38
39
40const run = await client.actor("abotapi/target-au-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