const element: ElementHandle | null = await page.$('span.label-status'); const shouldBeString: string = await element?.$eval('a', (el): string => el.innerText);
shouldBeString
Type 'ElementHandle<any> | undefined' is not assignable to type 'string'. Type 'undefined' is not assignable to type 'string'.
$eval()
Join the Discord to ask follow-up questions and connect with the community
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934 Members