When trying to capture a screenshot and save it in casperjs, it throws the following error
[error] [phantom] Failed to save screenshot to a local directory. please check permissions
Tried lot of ways like
I am using Windows 7 64 bit machine.
Already gone through this link here
I had the same error. and from what i found , it's also possible getting this error when the screenshot retrieved from a url/link which has no response body (see also here)
So I solved that through something like that:
...
if (this.exists("body")) { // this refer to the casper object
this.capture(myTrgFile);
}
please note that the request body and the tag body are two different things. I used the tag ("body") in my example only because it usually appears when requesting an html page. (the tag body is locate in the request body)
hope that helps...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With