1.0.12 • Published 2 years ago

investing.com-scraper v1.0.12

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years 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

2 years ago

1.0.10

2 years ago

1.0.12

2 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago