i have a problem using puppeteer in web page i want to make a java script scraper and pass that information to my index.html page i can do it with node in vs code but can't use it in browser when i try to use the code in chrome it says require is not defined so after some digging in found out i have to use Require.js but i don't know how to use it help me Please
this is my code
const puppeteer = require('puppeteer');
async function site(url) {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto(url);
const [el] = await page.$x('/html/body/div[2]/div[2]/div/div/div/a[1]/div[1]/span[3]')
const txt = await el.getProperty('textContent')
const rawTxt = await txt.jsonValue();
console.log({rawTxt});
}
site('url')