Get element attribute
// by xpath
const [elementHandle] = await page.$x('.//a/@href');
const propertyHandle = await elementHandle.getProperty('value');
const propertyValue = await propertyHandle.jsonValue();
// by .jsonValue()
const [elementHandle] = await page.$x('.//a');
const propertyHandle = await elementHandle.getProperty('innerText');
const propertyValue = await propertyHandle.jsonValue();