We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, i'm new with this library and i'm trying to create a simple screenshot of the google website.
I'm using Symfony 3, here's my controller.
<?php namespace sandboxBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use JonnyW\PhantomJs\Client; class DefaultController extends Controller { public function indexAction() { $client = Client::getInstance(); $client->getEngine()->setPath('C:\\Users\\sdkca\\Desktop\\phantomjs-2.1.1-windows\\bin\\phantomjs.exe'); // In windows, phantomjs starts sometimes an infinite loop,to prevent that // Set proxy-type to none to make it work $client->getEngine()->setOptions(array( 'proxy-type' => 'none' )); $width = 800; $height = 600; $top = 0; $left = 0; $webPath = $this->container->getParameter('kernel.root_dir') . '/../web/'; /** * @see JonnyW\PhantomJs\Http\CaptureRequest **/ $request = $client->getMessageFactory()->createCaptureRequest('https://www.google.de', 'GET'); $request->setOutputFile($webPath.'screenshot.jpg'); $request->setViewportSize($width, $height); $request->setCaptureDimensions($width, $height, $top, $left); $request->setTimeout(5000); /** * @see JonnyW\PhantomJs\Http\Response **/ $response = $client->getMessageFactory()->createResponse(); // Send the request $client->send($request, $response); echo $client->getLog(); // Output log return $this->render('sandboxBundle:Default:template.html.twig', array( )); } }
I think everything is in order, however the image isn't created and the log only outputs :
Can't open 'none'
Basically, the error comes when i try to set proxy to none in the options. I need to start phantomjs with the --proxy-type=none parameter.
--proxy-type=none
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi, i'm new with this library and i'm trying to create a simple screenshot of the google website.
I'm using Symfony 3, here's my controller.
I think everything is in order, however the image isn't created and the log only outputs :
Can't open 'none'
Basically, the error comes when i try to set proxy to none in the options. I need to start phantomjs with the
--proxy-type=none
parameter.The text was updated successfully, but these errors were encountered: