I want to run javascript on a website, but when I do this, nothing changes, I get pdf, as if I am not running the javascript result, this is an example of what I am doing:
xvfb-run --server-args="-screen 0, 1024x768x24" wkhtmltoimage --run-script "javascript:(\$(function(){ \$("div").hide() ;}))" google.com google.png
I also have scripts without jquery, for example:
xvfb-run --server-args="-screen 0, 1024x768x24" wkhtmltopdf --run-script "javascript:(function(){ document.write("AHHHHHHHHHHHHHHHHHHHHHHHHHHHHH"); ;})" google.com p2.pdf
But, as I said, there is no effect on pdf or png (because I tried both whtmltoimage and wkhtmltopdf).
source
share