Reads every page you list, pulls out the details you asked for with AI, and adds one row per page to your sheet.
Uses
Google Sheets
Jina AI
OpenAI
Turn a list of web pages into spreadsheet rows
pageUrls to blank.Set pageUrls to blank.fieldsToExtract to blank.Set fieldsToExtract to blank.spreadsheetUrl to blank.Set spreadsheetUrl to blank.sheetName to Sheet1.Set sheetName to Sheet1.maxPageCharacters to 12000.Set maxPageCharacters to 12000.columnSeparator to |||.Set columnSeparator to |||.pageUrls by , and save it as pages.Split pageUrls by , and save it as pages.rowsWritten to 0.Set rowsWritten to 0.pagesWithoutRows to an empty list.Set pagesWithoutRows to an empty list.listedPage in pages:For each listedPage in pages:listedPage and save it as webPage.Trim listedPage and save it as webPage.webPage doesn't start with httpIf webPage doesn't start with httpYes
webPage to the end of pagesWithoutRows and save it as pagesWithoutRows.Add webPage to the end of pagesWithoutRows and save it as pagesWithoutRows.No
No steps
pageErrorIf a step below fails, save the error as pageErrorTry
webPage with Jina. Save it as page.Read the page at webPage with Jina. Save it as page.page.content and save it as pageText.Trim page.content and save it as pageText.pageText isn't emptyIf pageText isn't emptyYes
prompt to You are reading one web page and filling in one row of a spreadsheet.Set prompt to You are reading one web page and filling in one row of a spreadsheet.
Pull out these details, in this exact order:
fieldsToExtract
Reply with ONE line and nothing else. Separate the values with columnSeparator in the order listed above. Do not repeat the field names, do not add headings, bullets, numbering or any commentary, and do not wrap values in quotes. Write n/a for anything the page does not say.
Page address: webPage
Page content:
pageText truncated to maxPageCharacters characters.prompt. Save it as extraction.Ask OpenAI: prompt. Save it as extraction.extraction.response_text and save it as answerLine.Trim extraction.response_text and save it as answerLine.webPage] and save it as row.Create a list of [webPage] and save it as row.extractedValue in answerLine split by columnSeparator:For each extractedValue in answerLine split by columnSeparator:extractedValue to the end of row and save it as row. Add extractedValue to the end of row and save it as row.sheetName in spreadsheetUrl.Add a row to sheetName in spreadsheetUrl.rowsWritten.Add 1 to rowsWritten.No
webPage to the end of pagesWithoutRows and save it as pagesWithoutRows.Add webPage to the end of pagesWithoutRows and save it as pagesWithoutRows.On error
webPage to the end of pagesWithoutRows and save it as pagesWithoutRows.Add webPage to the end of pagesWithoutRows and save it as pagesWithoutRows.pageError as text.Show in the output: Could not read '@webPage': pageError as text.rowsWritten as text row(s) to '@sheetName'.Show in the output: Finished. Wrote rowsWritten as text row(s) to '@sheetName'.pagesWithoutRows isn't emptyIf pagesWithoutRows isn't emptyYes
pagesWithoutRows joined by , .Show in the output: No row was written for: pagesWithoutRows joined by , .No
No steps