html - UrlFetchApp.fetch() incomplete content on google.com -
I'm starting with Google Apps Script coding.
So I tried this example:
// The code below logs the HTML code of the Google home page. Var response = UrlFetchApp.fetch ("http://www.google.com/"); Logger.log (response.getContentText ());
I'm getting the tag from:
Doctype html & gt; From & lt; Style & gt;
But these tags are not:
& lt; / Head>, & lt; Body & gt ;, & lt; / Body & gt; Or & lt; / Html & gt;
Is this an incorrect Google Apps Script instance or is it a mistake in my part? How do I reply to the complete HTML code from google.com?
Logger.log automatically shortens the shown string after a certain length Getting the page, but watching only the first part in the entrance.
// The code below logs to the HTML code of the Google home page. Var response = UrlFetchApp.fetch ("http://www.google.com/"); Var content = response.getContentText (); Logger.log (content); // enter the last 1000 characters of logger.log (content.substr (-1000));
Comments
Post a Comment