investing.com-scraper

1.0.12 • Public • Published

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.

Package Sidebar

Install

npm i investing.com-scraper

Weekly Downloads

0

Version

1.0.12

License

ISC

Unpacked Size

14 kB

Total Files

10

Last publish

Collaborators

  • pedropiloto