I am using this code in C# and it is working properly.
using PuppeteerSharp;
var links = page.EvaluateExpressionAsync<string[]>
("Array.from(document.querySelectorAll('a span'))
.map(a => a.textContent);").Result;
But when i tried to convert JavaScript using this code, it is not working.
const puppeteerChrome = require('puppeteer');
const links = await page.evaluate(() =>
Array.from(document.querySelectorAll('a span'))
.map(a => a.textContent));
How can i solve this problem.