I am trying to get the HTML page's source code using JavaScript (kind of like screenshot). And for styling, I am using external CSS. However, when I get the HTML source code, the styling won't be applied because I won't be able to get the CSS properties for the elements.
So, I am wondering if I can replace the CSS class name with actual CSS properties defined in that class. e.g.
for the HTML element,
<div class="exampleClass"><div>
And CSS,
.exampleClass {
background-color:#FFFFFF;
}
Then the extracted source code using Javascript will be
<div style="background-color:#FFFFFF;"><div>
How can I do this thing in JavaScript? Thanks