DEV Community

Discussion on: Scrape the Latest Stock Prices With NodeJS and Puppeteer!

Collapse
 
code_jedi profile image
Code_Jedi

Hey, here is the source code with the package.json and package-lock.json files: github.com/matveynikon/Stock_scrap...

Collapse
 
marianpirvan profile image
marianpirvan • Edited

It's work if you run node index.js ,but why show 652.81 multiple time?

Dont' work on console .log :(
index.js:2 Uncaught ReferenceError: require is not defined
{
"name": "stocks",
"version": "1.0.0",
"description": "",
"main": "stock.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Me",
"license": "ISC",
"dependencies": {
"puppeteer": "^10.1.0"
}
}

Thread Thread
 
code_jedi profile image
Code_Jedi

that means that the stock price still hasn't changed

Thread Thread
 
marianpirvan profile image
marianpirvan

At that time check value of stock, hourly, daily?

Thread Thread
 
code_jedi profile image
Code_Jedi

First of all, the price will change only when the stock market is open, so it's useless to run the scraper when the market is closed, and even when it's open, the stock price won't change all the time. With that said, this scraper checks the stock price every second.

Thread Thread
 
marianpirvan profile image
marianpirvan

Thanks a lot, i love your work, and help, cheers!