This is how I currently get each DOM property from an ElementHandle :
let section: ElementHandle = await page.waitForSelector(".selector-list li");
let tagName = await section.$eval('a', (e) => e.tagName);
But here it's tagName. What if I'd like want to inspect further properties ?
I don't want to write $eval for each property.
Question:
How can I convert ElementHandle to a Dom object , so I'd be able
to browse all properties ?
I want to get A as a Dom object.
The better way would be to execute the code on the page via page.evaluate and return the results. That way you can return an array with values:
resultwill then be an array with the attribute values oftagNameof each element.