diff --git a/index.js b/index.js index 8bdfcad..53154cd 100644 --- a/index.js +++ b/index.js @@ -85,6 +85,8 @@ async function main() { for (let element of elements) { let box = await element.boundingBox(); + let classNameAttr = await element.getProperty('className'); + let className = await classNameAttr.jsonValue(); // Scale the bounding box box.x /= size.width; @@ -95,6 +97,10 @@ async function main() { // Give the selector as type box.type = selector; + if (className !== "") { + box.class = className; + } + info.push(box); }