Skip to content
NEWMarketplace and the trig8n Agent: sell what you build, and get plans and changes that are tested before you see them. See what is new

Library / Documents, PDF & OCR

Documents, PDF & OCR

Archive changed web pages as dated PDFs in Google Drive using Gaffa and Sheets

Each morning checks the pages listed in a Google Sheet with Gaffa and saves a new PDF to Google Drive whenever the page text has changed, keeping a dated record.

What it does

## Archive changed web pages as PDFs in Google Drive with Google Sheets and Gaffa Keep a dated PDF of the pages you care about. Each morning the workflow checks the pages in a Google Sheet and saves a new PDF to Google Drive when the text has changed. ### Who's it for Compliance and legal teams keeping a record of terms and policies, and teams tracking competitor pricing pages. ### How it works - Gaffa opens each page in a real browser and waits a few seconds, so JavaScript-rendered pages work. In one request it turns the page into text with generate_markdown and prints it to a PDF with print. - A hash of the text is compared with the one in the sheet. When it differs, the PDF goes to your Drive folder as "Name date.pdf" and the row gets the new hash, the date and a link. - The first run saves a PDF of every page. A page that cannot be read is noted in Status. ### Setup 1. Install the Gaffa community node. 2. Create an API key at gaffa.dev and add it as the Gaffa API credential. 3. Create a Google Sheet with a tab named Pages and the columns Name, Page URL, Selector, Last hash, Last changed, Last PDF, Last checked and Status, and add your pages. 4. Create a folder in Google Drive for the PDFs. 5. Connect Google Sheets and Google Drive, put the sheet URL and the folder URL in Settings and publish. ### Requirements - A Gaffa API key - A Google account for Sheets and Drive ### Customization tips - Pages with dates or ads change daily. Put a CSS selector like main in the Selector column to compare only that part. A selector that matches nothing shows as a failed read. - Raise wait_seconds in Settings for pages that load slowly. - Add margin or orientation to the print action in the Read the page node. - Change the time in the Every morning node.

The steps

  1. Every morning
  2. Settings
  3. Read the pages
  4. Only pages with a URL
  5. Read the page
  6. Page read?
  7. Note the error
  8. Hash the page text
  9. Changed?
  10. Fetch the PDF
  11. Save to Drive
  12. Note the change
  13. Note no change
  14. Update the row

Similar automations