Saves the text of a web page into a new Google Doc, even when the site won't hand its text to anything but a browser.
Uses
Google Docs
Jina AI
Save a hard-to-open web page as a Google Doc
pageUrl to blank.Set pageUrl to blank.minimumCharacters to 600.Set minimumCharacters to 600.maximumCharacters to 20000.Set maximumCharacters to 20000.pageUrl split by ://[1] and save it as afterScheme.Trim pageUrl split by ://[1] and save it as afterScheme.afterScheme by / and save it as hostAndPath.Split afterScheme by / and save it as hostAndPath.hostAndPath and save it as authorityPart.Trim the first item of hostAndPath and save it as authorityPart.authorityPart split by @ and save it as pageHost.Trim the last item of authorityPart split by @ and save it as pageHost.pageHost is empty or pageHost is nullIf pageHost is empty or pageHost is nullYes
No
No steps
hostAndPath with / and save it as pagePath.Join the items from index 1 onward of hostAndPath with / and save it as pagePath.pagePath split by ? and save it as pagePath.Get the first item of pagePath split by ? and save it as pagePath.pagePath split by # and save it as pagePath.Get the first item of pagePath split by # and save it as pagePath.pageScheme to http://.Set pageScheme to http://.pageUrl starts with https://If pageUrl starts with https://Yes
pageScheme to https://.Change pageScheme to https://.No
No steps
sourceLabel to pageScheme plus pageHost.Set sourceLabel to pageScheme plus pageHost.pagePath isn't emptyIf pagePath isn't emptyYes
sourceLabel to sourceLabel/pagePath.Change sourceLabel to sourceLabel/pagePath.No
No steps
directBody to blank.Set directBody to blank.directOk to false.Set directOk to false.directNote to blank.Set directNote to blank.fetchErrorIf a step below fails, save the error as fetchErrorTry
pageUrl and save it as response.Fetch pageUrl and save it as response.response.body and save it as directBody.Trim response.body and save it as directBody.directOk to response.ok is true.Change directOk to response.ok is true.directNote to A plain request to pageHost answered with status response.status.Change directNote to A plain request to pageHost answered with status response.status.On error
fetchError.message and save it as rawReason.Trim fetchError.message and save it as rawReason.directNote to A plain request to pageHost failed: rawReason with pageUrl replaced by the address you gave.Change directNote to A plain request to pageHost failed: rawReason with pageUrl replaced by the address you gave.directOk to false.Change directOk to false.directNote contains ://If directNote contains ://Yes
directNote to A plain request to pageHost could not be completed.Change directNote to A plain request to pageHost could not be completed.No
No steps
minimumLength to minimumCharacters multiplied by 1.Set minimumLength to minimumCharacters multiplied by 1.looksBlocked to false.Set looksBlocked to false.directOk is noIf directOk is noYes
looksBlocked to true.Change looksBlocked to true.No
No steps
directBody is less than minimumLengthIf the length of directBody is less than minimumLengthYes
looksBlocked to true.Change looksBlocked to true.No
No steps
directBody contains just a moment (ignoring case)If directBody contains just a moment (ignoring case)Yes
looksBlocked to true.Change looksBlocked to true.No
No steps
directBody contains enable javascript (ignoring case)If directBody contains enable javascript (ignoring case)Yes
looksBlocked to true.Change looksBlocked to true.No
No steps
directBody contains captcha (ignoring case)If directBody contains captcha (ignoring case)Yes
looksBlocked to true.Change looksBlocked to true.No
No steps
directBody contains access denied (ignoring case)If directBody contains access denied (ignoring case)Yes
looksBlocked to true.Change looksBlocked to true.No
No steps
directBody contains attention required (ignoring case)If directBody contains attention required (ignoring case)Yes
looksBlocked to true.Change looksBlocked to true.No
No steps
directBody contains verify you are human (ignoring case)If directBody contains verify you are human (ignoring case)Yes
looksBlocked to true.Change looksBlocked to true.No
No steps
directBody contains are you a robot (ignoring case)If directBody contains are you a robot (ignoring case)Yes
looksBlocked to true.Change looksBlocked to true.No
No steps
readableText to blank.Set readableText to blank.pageTitle to blank.Set pageTitle to blank.readVia to blank.Set readVia to blank.looksBlocked is yesIf looksBlocked is yesYes
readerErrorIf a step below fails, save the error as readerErrorTry
pageUrl with Jina. Save it as reader.Read the page at pageUrl with Jina. Save it as reader.reader.content and save it as readableText.Trim reader.content and save it as readableText.reader.title and save it as pageTitle.Trim reader.title and save it as pageTitle.On error
pageHost. Check the address, and check you are able to open the page yourself.Stop and report a problem: Neither a plain request nor the reader service could get the text of that page on pageHost. Check the address, and check you are able to open the page yourself.readVia to Read through the reader service, because the plain request did not come back with the page..Change readVia to Read through the reader service, because the plain request did not come back with the page..No
readableText to directBody.Change readableText to directBody.readVia to Read with a plain request. The reader service was not needed..Change readVia to Read with a plain request. The reader service was not needed..readableText is nullIf readableText is nullYes
readableText to blank.Change readableText to blank.No
No steps
readableText is emptyIf readableText is emptyYes
pageHost came back with no readable text at all, so there was nothing to save.Stop and report a problem: That page on pageHost came back with no readable text at all, so there was nothing to save.No
No steps
documentTitle to pageHost.Set documentTitle to pageHost.pageTitle isn't empty and pageTitle is not nullIf pageTitle isn't empty and pageTitle is not nullYes
documentTitle to pageTitle.Change documentTitle to pageTitle.No
No steps
documentTitle to 90 characters and save it as documentTitle.Shorten documentTitle to 90 characters and save it as documentTitle.document to nothing.Set document to nothing.documentId to blank.Set documentId to blank.documentErrorIf a step below fails, save the error as documentErrorTry
documentTitle. Save it as document.Create the document documentTitle. Save it as document.document.document_id and save it as documentId.Trim document.document_id and save it as documentId.On error
documentId is empty or documentId is nullIf documentId is empty or documentId is nullYes
No
No steps
header to Source: sourceLabelSet header to Source: sourceLabel
readVia
.header to header@directNoteChange header to header@directNote
.documentText to header plus readableText truncated to a record of kind, op, left, and right characters.Set documentText to header plus readableText truncated to a record of kind, op, left, and right characters.documentId.Add text to documentId.documentTextpageHost to a new Google Doc.Show in the output: Saved the readable text of pageHost to a new Google Doc.