Giter Site home page Giter Site logo

stock-market-scrape's Introduction

bk-scrape

might work

execute bk-scrape

otherwise:

  1. download nodejs
  2. download this repo
  3. run npm install in the repo directory
  4. run npm start in the repo directory

From Barchart:

Index URL
S&P 500 https://www.barchart.com/stocks/indices/sp/sp500?viewName=main
Russ 2k https://www.barchart.com/stocks/indices/russell/russell2000?viewName=main
DJ https://www.barchart.com/stocks/quotes/$DOWI/components?viewName=main&orderBy=symbol&orderDir=asc
NDX https://www.barchart.com/stocks/indices/nasdaq/nasdaq100?viewName=main

From websites other than Barchart:

Index URL
NIK225 https://indexes.nikkei.co.jp/en/nkave/index/component
Euro Stoxx 50 https://www.dividendmax.com/market-index-constituents/euro-stoxx-50
Euro Stoxx 600 https://www.marketscreener.com/quote/index/STOXX-EUROPE-600-EUR-7477/components/

excel snippet

Excel.run(async (context) => {
// Get the active worksheet
let sheet = context.workbook.worksheets.getActiveWorksheet();

// Make an HTTP request to get the CSV data
const response = await fetch('https://bk.keiserdev.com/sp500');
const csvText = await response.text();

// Assuming the CSV data is separated by commas and new lines
const csvRows = csvText.trim().split('\n').map(row => row.split(','));

// Find the range to place the data based on the size of the CSV
const rowCount = csvRows.length;
const columnCount = csvRows[0].length;
const dataRange = sheet.getRangeByIndexes(0, 0, rowCount, columnCount);

// Set the CSV data in the worksheet
dataRange.values = csvRows;

// Format the header to stand out
const headerRange = sheet.getRangeByIndexes(0, 0, 1, columnCount);
headerRange.format.fill.color = "#4472C4";
headerRange.format.font.color = "white";
headerRange.format.font.bold = true;

await context.sync();
}).catch(error => {
    console.error(error);
});

stock-market-scrape's People

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.