1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "startUrls": [
12 {
13 "url": "https://www.investing.com/indices/eu-stoxx50-news/"
14 },
15 {
16 "url": "https://www.investing.com/news/latest-news/"
17 },
18 {
19 "url": "https://www.investing.com/news/most-popular-news/"
20 },
21 {
22 "url": "https://www.investing.com/news/headlines/"
23 },
24 {
25 "url": "https://www.investing.com/news/cryptocurrency-news/"
26 },
27 {
28 "url": "https://www.investing.com/news/stock-market-news/"
29 },
30 {
31 "url": "https://www.investing.com/news/commodities-news/"
32 },
33 {
34 "url": "https://www.investing.com/news/forex-news/"
35 },
36 {
37 "url": "https://www.investing.com/news/economy/"
38 },
39 {
40 "url": "https://www.investing.com/news/economic-indicators/"
41 },
42 {
43 "url": "https://www.investing.com/news/politics/"
44 },
45 {
46 "url": "https://www.investing.com/news/world-news/"
47 }
48 ],
49 "dateRange": "2023/1/5 - 2020/1/5",
50 "maxArticles": 50,
51 "maxDepth": 20,
52 "proxyConfiguration": {
53 "useApifyProxy": false
54 }
55};
56
57
58const run = await client.actor("glitch_404/investing-scraper").call(input);
59
60
61console.log('Results from dataset');
62console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
63const { items } = await client.dataset(run.defaultDatasetId).listItems();
64items.forEach((item) => {
65 console.dir(item);
66});
67
68