Open damphat opened 11 years ago
params can be Function in phatomjs, but node-phantom currently does not support it.
Function
phatomjs
node-phantom
function getBodyHTML(){ return document.body.innerHTML } var phantom = require('node-phantom') phantom.create(function(_, ph){ ph.createPage(function(_, page){ page.open('http://example.com', function(_, status){ console.log(status); page.evaluate(function(aFunc) { return aFunc() // FAILED HERE !!!!!!! }, function(_, ret){ console.log(ret) }, getBodyHTML) }) }) })
I currently solve the problem by func.toString() then eval. But I would like node-phantom can support function serialize.
func.toString()
eval
+1
params can be
Function
inphatomjs
, butnode-phantom
currently does not support it.I currently solve the problem by
func.toString()
theneval
. But I would likenode-phantom
can support function serialize.