Open eugen35 opened 6 years ago
var phridge = require("phridge"); var path = require("path"); var jqueryPath = path.resolve(__dirname, "jquery-1.6.1.min.js");
phridge.spawn() .then(function (phantom) { return phantom.openPage("http://localhost:3000/"); }) .then(function (page) { page.injectJs(jqueryPath); return page.run(function () { return this.evaluate(function () { return $("button").innerText; }); }); })
gives an error: TypeError: page.injectJs is not a function
var phridge = require("phridge"); var path = require("path"); var jqueryPath = path.resolve(__dirname, "jquery-1.6.1.min.js");
phridge.spawn() .then(function (phantom) { return phantom.openPage("http://localhost:3000/"); }) .then(function (page) { page.injectJs(jqueryPath); return page.run(function () { return this.evaluate(function () { return $("button").innerText; }); }); })
gives an error: TypeError: page.injectJs is not a function