we are trying to take screenshot of home page of website.. the steps are as follows;
- type url of the website - https://www.google.com
- based on point 1. it should capture whatever is appearing on the home page of www.google.com (i.e. search bar etc)
- and this captured homepage screenshot should show on our site.
we tried using the following and getting some error. Tech Stack Language used for the website - PHP Yii Application used - phantomjs, console version of webkit Server hosted - Amazon AWS Linux
Error Message on Screen;
// run screenshot grab function async
// $curl = curl_init();
// curl_setopt($curl, CURLOPT_URL, Url::toRoute(['/screenshot/screenshot'], true));
// curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
// curl_setopt($curl, CURLOPT_POST, true);
// curl_setopt($curl, CURLOPT_POSTFIELDS, "id=".$model->id);
// $out = curl_exec($curl);
// curl_close($curl);
$client = new Client();
$client->post(Url::toRoute(['/screenshot/screenshot'], true), ['future' => true,
'body' =>['id'=>$model->id]]);
// return $this->redirect(['view', 'id' => $model->id]);
return $this->redirect([$model->categoryUrl]);
} else {
// return $this->render('create', [
// 'model' => $model,
// ]);
let me know if anything else is i have missed. Appreciate if anyone can help.
Aucun commentaire:
Enregistrer un commentaire