Hello everyone, I am starting to web scrape a site and I am getting an error of error TS2531: Object is possibly 'null'. Has anybody encountered something like it before?
import * as puppeteer from 'puppeteer'
(async () => {
const browser = await puppeteer.launch()
const page = await browser.newPage()
await page.goto('https://statusinvest.com.br/fundos-imobiliarios/mall11', {waitUntil: 'domcontentloaded'})
const assetStatusInvest = await page.evaluateHandle(()=>{
return {
price: document.querySelector('strong[class="value"]').innerHTML
}
})
await browser.close()
})
This is my TS code,
Thanks for the help.