screenshot using googlepagespeed api











up vote
0
down vote

favorite
1












Below is my code to capture the screenshot of of webpage. But i get the output of the same as how in the image below. Kindly suggest on what is the mistake i am committing. Also kindly suggest the method to save this screenshot to the server?



enter image description here



<?php
$url='https://www.google.com';
$stratedy = 'mobile' ;
$apiReqUrl = 'https://www.googleapis.com/pagespeedonline/v2/runPagespeed';
$apiKey = 'my_api_key' ;
$curl = curl_init();
curl_setopt($curl, CURL_OPTURL, $apiReqUrl.'?url='.$reqUrl.'
&key='.$apiKey.'&screenshot=true&strategy='.$stratedy);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
$result=curl_exec($curl);
$data = json_decode($result, true);
$img = str_replace(array('_','-'), array('/','+'), $data['screenshot']
['data']);
echo '<img src="data:image/jpeg;base64,'.$img.'">';
?>









share|improve this question
























  • Did you try this: Generating Screenshots of URLs using Google's secret magic API? It's my article and I have also given some example snippets.
    – Praveen Kumar Purushothaman
    Nov 12 at 10:41

















up vote
0
down vote

favorite
1












Below is my code to capture the screenshot of of webpage. But i get the output of the same as how in the image below. Kindly suggest on what is the mistake i am committing. Also kindly suggest the method to save this screenshot to the server?



enter image description here



<?php
$url='https://www.google.com';
$stratedy = 'mobile' ;
$apiReqUrl = 'https://www.googleapis.com/pagespeedonline/v2/runPagespeed';
$apiKey = 'my_api_key' ;
$curl = curl_init();
curl_setopt($curl, CURL_OPTURL, $apiReqUrl.'?url='.$reqUrl.'
&key='.$apiKey.'&screenshot=true&strategy='.$stratedy);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
$result=curl_exec($curl);
$data = json_decode($result, true);
$img = str_replace(array('_','-'), array('/','+'), $data['screenshot']
['data']);
echo '<img src="data:image/jpeg;base64,'.$img.'">';
?>









share|improve this question
























  • Did you try this: Generating Screenshots of URLs using Google's secret magic API? It's my article and I have also given some example snippets.
    – Praveen Kumar Purushothaman
    Nov 12 at 10:41















up vote
0
down vote

favorite
1









up vote
0
down vote

favorite
1






1





Below is my code to capture the screenshot of of webpage. But i get the output of the same as how in the image below. Kindly suggest on what is the mistake i am committing. Also kindly suggest the method to save this screenshot to the server?



enter image description here



<?php
$url='https://www.google.com';
$stratedy = 'mobile' ;
$apiReqUrl = 'https://www.googleapis.com/pagespeedonline/v2/runPagespeed';
$apiKey = 'my_api_key' ;
$curl = curl_init();
curl_setopt($curl, CURL_OPTURL, $apiReqUrl.'?url='.$reqUrl.'
&key='.$apiKey.'&screenshot=true&strategy='.$stratedy);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
$result=curl_exec($curl);
$data = json_decode($result, true);
$img = str_replace(array('_','-'), array('/','+'), $data['screenshot']
['data']);
echo '<img src="data:image/jpeg;base64,'.$img.'">';
?>









share|improve this question















Below is my code to capture the screenshot of of webpage. But i get the output of the same as how in the image below. Kindly suggest on what is the mistake i am committing. Also kindly suggest the method to save this screenshot to the server?



enter image description here



<?php
$url='https://www.google.com';
$stratedy = 'mobile' ;
$apiReqUrl = 'https://www.googleapis.com/pagespeedonline/v2/runPagespeed';
$apiKey = 'my_api_key' ;
$curl = curl_init();
curl_setopt($curl, CURL_OPTURL, $apiReqUrl.'?url='.$reqUrl.'
&key='.$apiKey.'&screenshot=true&strategy='.$stratedy);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
$result=curl_exec($curl);
$data = json_decode($result, true);
$img = str_replace(array('_','-'), array('/','+'), $data['screenshot']
['data']);
echo '<img src="data:image/jpeg;base64,'.$img.'">';
?>






php google-api






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 12 at 11:02









Praveen Kumar Purushothaman

131k23133179




131k23133179










asked Nov 12 at 10:40









Keerthana A

176




176












  • Did you try this: Generating Screenshots of URLs using Google's secret magic API? It's my article and I have also given some example snippets.
    – Praveen Kumar Purushothaman
    Nov 12 at 10:41




















  • Did you try this: Generating Screenshots of URLs using Google's secret magic API? It's my article and I have also given some example snippets.
    – Praveen Kumar Purushothaman
    Nov 12 at 10:41


















Did you try this: Generating Screenshots of URLs using Google's secret magic API? It's my article and I have also given some example snippets.
– Praveen Kumar Purushothaman
Nov 12 at 10:41






Did you try this: Generating Screenshots of URLs using Google's secret magic API? It's my article and I have also given some example snippets.
– Praveen Kumar Purushothaman
Nov 12 at 10:41














1 Answer
1






active

oldest

votes

















up vote
1
down vote













If you can, try using the HTML version from Generating Screenshots of URLs using Google's secret magic API. All you need to do is to call the API and it's free (I guess).



For example in PHP:



<?php  

$url = "https://praveen.science/";

// Hit the Google PageSpeed Insights API.
// Catch: Your server needs to allow file_get_contents() to make this run. Or you need to use cURL.
$response = file_get_contents('https://www.googleapis.com/pagespeedonline/v2/runPagespeed?screenshot=true&url='.urlencode($url));

// Convert the JSON response into an array.
$googlePagespeedObject = json_decode($response, true);

// Grab the Screenshot data.
$screenshot = $googlePagespeedObject['screenshot']['data'];

// Fix url encoded base64
$screenshot = str_replace(array('_','-'), array('/','+'), $screenshot);

// Build the Data URI scheme and spit out an <img /> Tag.
echo "<img src="data:image/jpeg;base64,{$screenshot}" alt="Screenshot" />";

// Or.. base64 decode and store
file_put_contents('...', base64_decode($screenshot));


Or in JavaScript:






$(function() {
// Get the URL.
var url = "https://praveen.science/";
// Prepare the URL.
url = encodeURIComponent(url);
// Hit the Google Page Speed API.
$.get("https://www.googleapis.com/pagespeedonline/v1/runPagespeed?screenshot=true&strategy=mobile&url=" + url, function(data) {
// Get the screenshot data.
var screenshot = data.screenshot;
// Convert the Google's Data to Data URI scheme.
var imageData = screenshot.data.replace(/_/g, "/").replace(/-/g, "+");
// Build the Data URI.
var dataURI = "data:" + screenshot.mime_type + ";base64," + imageData;
// Set the image's source.
$("img").attr("src", dataURI);
});
});

<script src="https://code.jquery.com/jquery-2.2.4.js"></script>
<h1>Hard Coded Screenshot of my Website:</h1>
<img src="//placehold.it/300x50?text=Loading+Screenshot..." alt="Screenshot" />








share|improve this answer























  • This didnt work for me :(
    – Keerthana A
    Nov 12 at 10:55










  • Added your PHP version, hope you don't mind, the OP wanted in PHP.. nice blog.. ✓ +1
    – Lawrence Cherone
    Nov 12 at 10:56












  • @LawrenceCherone Thanks... :) Doesn't rot. Lives till I live. :)
    – Praveen Kumar Purushothaman
    Nov 12 at 10:56












  • @KeerthanaA Did it work in your PC at all? When you clicked on the Run code snippet, did you see the screenshot getting generated?
    – Praveen Kumar Purushothaman
    Nov 12 at 10:57










  • @PraveenKumarPurushothaman Nope its not running Gives me the following error. { "message": "Uncaught ReferenceError: $ is not defined", "filename": "stacksnippets.net/js", "lineno": 15, "colno": 9 }
    – Keerthana A
    Nov 12 at 11:10













Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53260431%2fscreenshot-using-googlepagespeed-api%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote













If you can, try using the HTML version from Generating Screenshots of URLs using Google's secret magic API. All you need to do is to call the API and it's free (I guess).



For example in PHP:



<?php  

$url = "https://praveen.science/";

// Hit the Google PageSpeed Insights API.
// Catch: Your server needs to allow file_get_contents() to make this run. Or you need to use cURL.
$response = file_get_contents('https://www.googleapis.com/pagespeedonline/v2/runPagespeed?screenshot=true&url='.urlencode($url));

// Convert the JSON response into an array.
$googlePagespeedObject = json_decode($response, true);

// Grab the Screenshot data.
$screenshot = $googlePagespeedObject['screenshot']['data'];

// Fix url encoded base64
$screenshot = str_replace(array('_','-'), array('/','+'), $screenshot);

// Build the Data URI scheme and spit out an <img /> Tag.
echo "<img src="data:image/jpeg;base64,{$screenshot}" alt="Screenshot" />";

// Or.. base64 decode and store
file_put_contents('...', base64_decode($screenshot));


Or in JavaScript:






$(function() {
// Get the URL.
var url = "https://praveen.science/";
// Prepare the URL.
url = encodeURIComponent(url);
// Hit the Google Page Speed API.
$.get("https://www.googleapis.com/pagespeedonline/v1/runPagespeed?screenshot=true&strategy=mobile&url=" + url, function(data) {
// Get the screenshot data.
var screenshot = data.screenshot;
// Convert the Google's Data to Data URI scheme.
var imageData = screenshot.data.replace(/_/g, "/").replace(/-/g, "+");
// Build the Data URI.
var dataURI = "data:" + screenshot.mime_type + ";base64," + imageData;
// Set the image's source.
$("img").attr("src", dataURI);
});
});

<script src="https://code.jquery.com/jquery-2.2.4.js"></script>
<h1>Hard Coded Screenshot of my Website:</h1>
<img src="//placehold.it/300x50?text=Loading+Screenshot..." alt="Screenshot" />








share|improve this answer























  • This didnt work for me :(
    – Keerthana A
    Nov 12 at 10:55










  • Added your PHP version, hope you don't mind, the OP wanted in PHP.. nice blog.. ✓ +1
    – Lawrence Cherone
    Nov 12 at 10:56












  • @LawrenceCherone Thanks... :) Doesn't rot. Lives till I live. :)
    – Praveen Kumar Purushothaman
    Nov 12 at 10:56












  • @KeerthanaA Did it work in your PC at all? When you clicked on the Run code snippet, did you see the screenshot getting generated?
    – Praveen Kumar Purushothaman
    Nov 12 at 10:57










  • @PraveenKumarPurushothaman Nope its not running Gives me the following error. { "message": "Uncaught ReferenceError: $ is not defined", "filename": "stacksnippets.net/js", "lineno": 15, "colno": 9 }
    – Keerthana A
    Nov 12 at 11:10

















up vote
1
down vote













If you can, try using the HTML version from Generating Screenshots of URLs using Google's secret magic API. All you need to do is to call the API and it's free (I guess).



For example in PHP:



<?php  

$url = "https://praveen.science/";

// Hit the Google PageSpeed Insights API.
// Catch: Your server needs to allow file_get_contents() to make this run. Or you need to use cURL.
$response = file_get_contents('https://www.googleapis.com/pagespeedonline/v2/runPagespeed?screenshot=true&url='.urlencode($url));

// Convert the JSON response into an array.
$googlePagespeedObject = json_decode($response, true);

// Grab the Screenshot data.
$screenshot = $googlePagespeedObject['screenshot']['data'];

// Fix url encoded base64
$screenshot = str_replace(array('_','-'), array('/','+'), $screenshot);

// Build the Data URI scheme and spit out an <img /> Tag.
echo "<img src="data:image/jpeg;base64,{$screenshot}" alt="Screenshot" />";

// Or.. base64 decode and store
file_put_contents('...', base64_decode($screenshot));


Or in JavaScript:






$(function() {
// Get the URL.
var url = "https://praveen.science/";
// Prepare the URL.
url = encodeURIComponent(url);
// Hit the Google Page Speed API.
$.get("https://www.googleapis.com/pagespeedonline/v1/runPagespeed?screenshot=true&strategy=mobile&url=" + url, function(data) {
// Get the screenshot data.
var screenshot = data.screenshot;
// Convert the Google's Data to Data URI scheme.
var imageData = screenshot.data.replace(/_/g, "/").replace(/-/g, "+");
// Build the Data URI.
var dataURI = "data:" + screenshot.mime_type + ";base64," + imageData;
// Set the image's source.
$("img").attr("src", dataURI);
});
});

<script src="https://code.jquery.com/jquery-2.2.4.js"></script>
<h1>Hard Coded Screenshot of my Website:</h1>
<img src="//placehold.it/300x50?text=Loading+Screenshot..." alt="Screenshot" />








share|improve this answer























  • This didnt work for me :(
    – Keerthana A
    Nov 12 at 10:55










  • Added your PHP version, hope you don't mind, the OP wanted in PHP.. nice blog.. ✓ +1
    – Lawrence Cherone
    Nov 12 at 10:56












  • @LawrenceCherone Thanks... :) Doesn't rot. Lives till I live. :)
    – Praveen Kumar Purushothaman
    Nov 12 at 10:56












  • @KeerthanaA Did it work in your PC at all? When you clicked on the Run code snippet, did you see the screenshot getting generated?
    – Praveen Kumar Purushothaman
    Nov 12 at 10:57










  • @PraveenKumarPurushothaman Nope its not running Gives me the following error. { "message": "Uncaught ReferenceError: $ is not defined", "filename": "stacksnippets.net/js", "lineno": 15, "colno": 9 }
    – Keerthana A
    Nov 12 at 11:10















up vote
1
down vote










up vote
1
down vote









If you can, try using the HTML version from Generating Screenshots of URLs using Google's secret magic API. All you need to do is to call the API and it's free (I guess).



For example in PHP:



<?php  

$url = "https://praveen.science/";

// Hit the Google PageSpeed Insights API.
// Catch: Your server needs to allow file_get_contents() to make this run. Or you need to use cURL.
$response = file_get_contents('https://www.googleapis.com/pagespeedonline/v2/runPagespeed?screenshot=true&url='.urlencode($url));

// Convert the JSON response into an array.
$googlePagespeedObject = json_decode($response, true);

// Grab the Screenshot data.
$screenshot = $googlePagespeedObject['screenshot']['data'];

// Fix url encoded base64
$screenshot = str_replace(array('_','-'), array('/','+'), $screenshot);

// Build the Data URI scheme and spit out an <img /> Tag.
echo "<img src="data:image/jpeg;base64,{$screenshot}" alt="Screenshot" />";

// Or.. base64 decode and store
file_put_contents('...', base64_decode($screenshot));


Or in JavaScript:






$(function() {
// Get the URL.
var url = "https://praveen.science/";
// Prepare the URL.
url = encodeURIComponent(url);
// Hit the Google Page Speed API.
$.get("https://www.googleapis.com/pagespeedonline/v1/runPagespeed?screenshot=true&strategy=mobile&url=" + url, function(data) {
// Get the screenshot data.
var screenshot = data.screenshot;
// Convert the Google's Data to Data URI scheme.
var imageData = screenshot.data.replace(/_/g, "/").replace(/-/g, "+");
// Build the Data URI.
var dataURI = "data:" + screenshot.mime_type + ";base64," + imageData;
// Set the image's source.
$("img").attr("src", dataURI);
});
});

<script src="https://code.jquery.com/jquery-2.2.4.js"></script>
<h1>Hard Coded Screenshot of my Website:</h1>
<img src="//placehold.it/300x50?text=Loading+Screenshot..." alt="Screenshot" />








share|improve this answer














If you can, try using the HTML version from Generating Screenshots of URLs using Google's secret magic API. All you need to do is to call the API and it's free (I guess).



For example in PHP:



<?php  

$url = "https://praveen.science/";

// Hit the Google PageSpeed Insights API.
// Catch: Your server needs to allow file_get_contents() to make this run. Or you need to use cURL.
$response = file_get_contents('https://www.googleapis.com/pagespeedonline/v2/runPagespeed?screenshot=true&url='.urlencode($url));

// Convert the JSON response into an array.
$googlePagespeedObject = json_decode($response, true);

// Grab the Screenshot data.
$screenshot = $googlePagespeedObject['screenshot']['data'];

// Fix url encoded base64
$screenshot = str_replace(array('_','-'), array('/','+'), $screenshot);

// Build the Data URI scheme and spit out an <img /> Tag.
echo "<img src="data:image/jpeg;base64,{$screenshot}" alt="Screenshot" />";

// Or.. base64 decode and store
file_put_contents('...', base64_decode($screenshot));


Or in JavaScript:






$(function() {
// Get the URL.
var url = "https://praveen.science/";
// Prepare the URL.
url = encodeURIComponent(url);
// Hit the Google Page Speed API.
$.get("https://www.googleapis.com/pagespeedonline/v1/runPagespeed?screenshot=true&strategy=mobile&url=" + url, function(data) {
// Get the screenshot data.
var screenshot = data.screenshot;
// Convert the Google's Data to Data URI scheme.
var imageData = screenshot.data.replace(/_/g, "/").replace(/-/g, "+");
// Build the Data URI.
var dataURI = "data:" + screenshot.mime_type + ";base64," + imageData;
// Set the image's source.
$("img").attr("src", dataURI);
});
});

<script src="https://code.jquery.com/jquery-2.2.4.js"></script>
<h1>Hard Coded Screenshot of my Website:</h1>
<img src="//placehold.it/300x50?text=Loading+Screenshot..." alt="Screenshot" />








$(function() {
// Get the URL.
var url = "https://praveen.science/";
// Prepare the URL.
url = encodeURIComponent(url);
// Hit the Google Page Speed API.
$.get("https://www.googleapis.com/pagespeedonline/v1/runPagespeed?screenshot=true&strategy=mobile&url=" + url, function(data) {
// Get the screenshot data.
var screenshot = data.screenshot;
// Convert the Google's Data to Data URI scheme.
var imageData = screenshot.data.replace(/_/g, "/").replace(/-/g, "+");
// Build the Data URI.
var dataURI = "data:" + screenshot.mime_type + ";base64," + imageData;
// Set the image's source.
$("img").attr("src", dataURI);
});
});

<script src="https://code.jquery.com/jquery-2.2.4.js"></script>
<h1>Hard Coded Screenshot of my Website:</h1>
<img src="//placehold.it/300x50?text=Loading+Screenshot..." alt="Screenshot" />





$(function() {
// Get the URL.
var url = "https://praveen.science/";
// Prepare the URL.
url = encodeURIComponent(url);
// Hit the Google Page Speed API.
$.get("https://www.googleapis.com/pagespeedonline/v1/runPagespeed?screenshot=true&strategy=mobile&url=" + url, function(data) {
// Get the screenshot data.
var screenshot = data.screenshot;
// Convert the Google's Data to Data URI scheme.
var imageData = screenshot.data.replace(/_/g, "/").replace(/-/g, "+");
// Build the Data URI.
var dataURI = "data:" + screenshot.mime_type + ";base64," + imageData;
// Set the image's source.
$("img").attr("src", dataURI);
});
});

<script src="https://code.jquery.com/jquery-2.2.4.js"></script>
<h1>Hard Coded Screenshot of my Website:</h1>
<img src="//placehold.it/300x50?text=Loading+Screenshot..." alt="Screenshot" />






share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 12 at 10:58

























answered Nov 12 at 10:43









Praveen Kumar Purushothaman

131k23133179




131k23133179












  • This didnt work for me :(
    – Keerthana A
    Nov 12 at 10:55










  • Added your PHP version, hope you don't mind, the OP wanted in PHP.. nice blog.. ✓ +1
    – Lawrence Cherone
    Nov 12 at 10:56












  • @LawrenceCherone Thanks... :) Doesn't rot. Lives till I live. :)
    – Praveen Kumar Purushothaman
    Nov 12 at 10:56












  • @KeerthanaA Did it work in your PC at all? When you clicked on the Run code snippet, did you see the screenshot getting generated?
    – Praveen Kumar Purushothaman
    Nov 12 at 10:57










  • @PraveenKumarPurushothaman Nope its not running Gives me the following error. { "message": "Uncaught ReferenceError: $ is not defined", "filename": "stacksnippets.net/js", "lineno": 15, "colno": 9 }
    – Keerthana A
    Nov 12 at 11:10




















  • This didnt work for me :(
    – Keerthana A
    Nov 12 at 10:55










  • Added your PHP version, hope you don't mind, the OP wanted in PHP.. nice blog.. ✓ +1
    – Lawrence Cherone
    Nov 12 at 10:56












  • @LawrenceCherone Thanks... :) Doesn't rot. Lives till I live. :)
    – Praveen Kumar Purushothaman
    Nov 12 at 10:56












  • @KeerthanaA Did it work in your PC at all? When you clicked on the Run code snippet, did you see the screenshot getting generated?
    – Praveen Kumar Purushothaman
    Nov 12 at 10:57










  • @PraveenKumarPurushothaman Nope its not running Gives me the following error. { "message": "Uncaught ReferenceError: $ is not defined", "filename": "stacksnippets.net/js", "lineno": 15, "colno": 9 }
    – Keerthana A
    Nov 12 at 11:10


















This didnt work for me :(
– Keerthana A
Nov 12 at 10:55




This didnt work for me :(
– Keerthana A
Nov 12 at 10:55












Added your PHP version, hope you don't mind, the OP wanted in PHP.. nice blog.. ✓ +1
– Lawrence Cherone
Nov 12 at 10:56






Added your PHP version, hope you don't mind, the OP wanted in PHP.. nice blog.. ✓ +1
– Lawrence Cherone
Nov 12 at 10:56














@LawrenceCherone Thanks... :) Doesn't rot. Lives till I live. :)
– Praveen Kumar Purushothaman
Nov 12 at 10:56






@LawrenceCherone Thanks... :) Doesn't rot. Lives till I live. :)
– Praveen Kumar Purushothaman
Nov 12 at 10:56














@KeerthanaA Did it work in your PC at all? When you clicked on the Run code snippet, did you see the screenshot getting generated?
– Praveen Kumar Purushothaman
Nov 12 at 10:57




@KeerthanaA Did it work in your PC at all? When you clicked on the Run code snippet, did you see the screenshot getting generated?
– Praveen Kumar Purushothaman
Nov 12 at 10:57












@PraveenKumarPurushothaman Nope its not running Gives me the following error. { "message": "Uncaught ReferenceError: $ is not defined", "filename": "stacksnippets.net/js", "lineno": 15, "colno": 9 }
– Keerthana A
Nov 12 at 11:10






@PraveenKumarPurushothaman Nope its not running Gives me the following error. { "message": "Uncaught ReferenceError: $ is not defined", "filename": "stacksnippets.net/js", "lineno": 15, "colno": 9 }
– Keerthana A
Nov 12 at 11:10




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53260431%2fscreenshot-using-googlepagespeed-api%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown