node 怎么获取页面的dom以及样式,并发送邮件
目前采用的是获取dom,将dom的style全部内联到dom中,下面的代码:
const el = document.querySelector(name);
const els = el.getElementsByTagName('*');
for(let i = 0; i < els.length; i++) {
els[i].setAttribute('style', window.getComputedStyle(els[i]).cssText);
}
然后将dom插入html,发送 但是样式好像不太一样 希望大家给点建议,有没有好的办法