Closed kongou-ae closed 9 years ago
page.evaluateでできた。
page.evaluate(function (cssPath) {
var cssPath = '../css/pdf.css';
var head = document.querySelector("head")
var css = document.createElement("link");
css.rel = "stylesheet";
css.href = cssPath;
css.type = "text/css";
head.appendChild(css);
var meta = document.createElement("meta");
meta.setAttribute('charset', 'utf-8');
head.appendChild(meta);
});
phantom.jsの機能でページにheadを追加できないものか。