1.0.12 • Published 1 year ago

investing.com-scraper v1.0.12

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Investing.com Scraper

Install

npm install investing.com-scraper

Usage

symbol is the human readable identifier that investing uses to identify an index.

options is an object with the following keys

  • debug Boolean launches chromium locally, omits headless mode (default: false)
  • browserInstance PuppeteerBrowser: bring your own browser instance for more control
const InvestingScraper = require("investing-scraper");

// which index to scrape?
const symbol = "us-spx-500";

// options
const options = {
  debug: false,
  browserInstance: undefined,
}

// get index quote
const indexQuote = await InvestingScraper.indexQuote(symbol);

Bring your own puppeteer

if you want to customize the settings for your puppeteer instance you can add your own puppeteer browser instance in the options.

const puppeteer = require('puppeteer-extra');
// add stealth plugin and use defaults (all evasion techniques)
const StealthPlugin = require('puppeteer-extra-plugin-stealth');
puppeteer.use(StealthPlugin());

const myPuppeteerInstance = await puppeteer.launch(myCustomSettings);

const result = await InvestingScraper.indexQuote("%5EGSPC", {
  browserInstance: myPuppeteerInstance
});

Demo

npm run demo

Contribute

Open PR or issue if you would like to have more features added.

1.0.11

1 year ago

1.0.10

1 year ago

1.0.12

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago