const puppeteer = require ('puppeteer');
async function grabStocks(url){
const browser = await puppeteer.launch();
const page = await browser.newpage();
await page.goto(url);
const[el] = await page.$x('//*[@id="home-contents"]/table/tbody/tr[3]/td[2]')
const src = await el.getProperty('src');
const srcTxt = await src.jasonValue();
console.log({srcTxt});
}
grabStocks ('http://www.nepalstock.com/todaysprice');
The error is this
> [roshan@fedora Web scraping project]$ node nepalstock.js
> internal/modules/cjs/loader.js:888 throw err; ^
>
> Error: Cannot find module '/home/roshan/Web scraping
> project/nepalstock.js'
> at Function.Module._resolveFilename (internal/modules/cjs/loader.js:885:15)
> at Function.Module._load (internal/modules/cjs/loader.js:730:27)
> at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
> at internal/main/run_main_module.js:17:47 { code: 'MODULE_NOT_FOUND', requireStack: []
I had installed the puppeteer in the same folder but it is showing this error.
nepalstock.jsdoesn't exist