You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I run this code from the phantomjs directory it works but when I run it from the plugin
I get the "Status: success" message but no example.png ?!
any help?
The text was updated successfully, but these errors were encountered:
Your image is saved in current working directory (cwd) which is unexpectedly not the one where your script nor PhantomJS executable sits in. It depends on where VSC was installed, for example on Windows it's usually C:\Program Files (x86)\Microsoft VS Code and that becomes cwd for PhantomJS when you start the debugger.
You can see what is your cwd when debugging by running this small script (in debugger):
To workaround this you could set desired cwd at the top of your PhantomJS script with fs.changeWorkingDirectory(...) or use absolute paths when you do page.render(..).
Hello
when I run this script hello.js from:
var page = require('webpage').create();
page.open('http://example.com', function(status) {
console.log("Status: " + status);
if(status === "success") {
page.render('example.png');
}
phantom.exit();
});
example.png is not saved to disk??!!!
hello.js is at: F:\Projects\web\phantomtest
phantomsjs is at: C:\Users\imspikey\Desktop\phantomjs-2.1.1-windows\bin
lunsh.js file:
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "phantomjs",
"request": "launch",
"file": "${workspaceRoot}/phantomtest/hello.js",
"webRoot": "${workspaceRoot}/phantomtest",
"runtimeExecutable": "C://Users//imspikey//Desktop//phantomjs-2.1.1-windows//bin//phantomjs.exe",
"runtimeArgs": [],
"sourceMaps": false
}
]
}
When I run this code from the phantomjs directory it works but when I run it from the plugin
I get the "Status: success" message but no example.png ?!
any help?
The text was updated successfully, but these errors were encountered: