screen
screen copied to clipboard
Not following redirects
Occasionally the scripts gets a URL that results in a server-side 301 or 302 redirect. When this happens, PhantomJS is not following it and I get the error:
Uncaught exception 'Screen\Exceptions\PhantomJsException' with message 'Unable to load the address!' in microweber/screen/src/Capture.php:259
I am using the following options/flags:
- ignore-ssl-errors = "true"
- ssl-protocol = "any"
- web-security = "true"
It works fine when the URL does not redirect. Any help would be appreciated.
$screenCapture = new Capture($url);
$screenCapture->setOptions([ 'ignore-ssl-errors' => 'yes', 'ssl-protocol' => "any", 'web-security' => "true" ]); Also working for me