Skip to content

Weekly

Archive a website to Drive as Markdown

Each page of a site is saved in Drive as a Markdown file you can read or reuse.

Runs
Weekly
Apps
Google Drive
AI
Not needed
Access
write (drive.file)

Send this to your assistant

Create a ClickRuntime automation: every Sunday, read the sitemap of example.com, convert each page to Markdown and save it in my Site archive Drive folder, updating files that already exist.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

A researcher tracks a documentation site, a competitor's help center and a policy page that changes quietly. To keep a record she saves pages as PDFs by hand, which break when she needs plain text, or pastes them into Docs, which loses structure. When she wants to give a body of pages to an AI model for analysis, the formatting noise makes the results worse, and there is no old copy to compare with.

Each week, ClickRuntime fetches your sitemap or a list of page addresses, downloads every page and converts the content to Markdown, which keeps headings, lists, links and tables as readable plain text. The Markdown files are uploaded to a Drive folder, and any file that already exists is updated in place instead of duplicated.

Knowledge-base builders, SEO teams and compliance staff use it for archives that stay readable years from now.

What you get out of it

  • A text archive that stays usable

    Markdown opens in any editor, searches quickly and does not depend on a particular tool surviving. A weekly copy of a help center remains readable long after the original site has been redesigned.

  • Clean input for AI work

    Plain headings and paragraphs, without navigation menus and scripts, make a much better source to hand to a language model. Summaries and question answering are more accurate when the text is not buried in markup.

  • A record of what a page said

    When a vendor changes its terms or a competitor edits a pricing page, a dated copy proves what the earlier wording was. That matters in disputes and in simply working out when something changed.

  • Less manual saving and pasting

    Gathering a hundred pages by hand takes a full day and is never repeated. A weekly run keeps the folder current without anyone reopening the site and copying pages one at a time.

  • Easy to diff and review

    Because Markdown is plain text, two versions of a page can be compared line by line with any diff tool. Reviewers see exactly the changed sentences instead of scanning two whole documents.

How it works

What happens, step by step

  1. Once a week ClickRuntime reads your website's list of pages.

  2. It downloads each page and keeps the headings, paragraphs and lists as clean Markdown text.

  3. Each page is saved as a file in your Google Drive archive folder, updating the file if it already exists.

  4. You end up with a readable copy of your whole site in Drive.

Before it runs live

  • Connect Google Drive

What you get

RunsWeekly
Archive a website to Drive as Markdowntoday, 9:00Succeeded
Google Drive · Site archiveexample.com_pricing.md updated example.com_blog_launch-week.md added

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Run it at a different time, more or less often, or only on weekdays
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other Google Drive steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
save_web_pages_to_drive_as_markdown.pyexample
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from bs4 import BeautifulSoup
from googleapiclient.http import MediaInMemoryUpload
from clickruntime import on_trigger, credentials, http

SITEMAP, FOLDER = "https://example.com/sitemap.xml", "site-archive-folder-id"

def to_markdown(html):
    soup = BeautifulSoup(html, "lxml")
    lines = []
    for el in soup.select("h1, h2, h3, p, li"):
        text = el.get_text(" ", strip=True)
        prefix = {"h1": "# ", "h2": "## ", "h3": "### ", "li": "- "}.get(el.name, "")
        if text:
            lines.append(prefix + text)
    return "\n\n".join(lines)

@on_trigger
def run(event):
    drive = build("drive", "v3", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
    urls = [loc.text for loc in BeautifulSoup(http.get(SITEMAP).text, "xml").find_all("loc")]
    existing = {f["name"]: f["id"] for f in drive.files().list(q=f"'{FOLDER}' in parents and trashed = false",
                                                               fields="files(id,name)", pageSize=1000).execute()["files"]}
    for url in urls:
        name = (url.split("://", 1)[1].strip("/").replace("/", "_") or "home") + ".md"
        media = MediaInMemoryUpload(to_markdown(http.get(url).text).encode(), "text/markdown")
        if name in existing:
            drive.files().update(fileId=existing[name], media_body=media).execute()
        else:
            drive.files().create(body={"name": name, "parents": [FOLDER]}, media_body=media).execute()
    return {"pages": len(urls)}

FAQ

Common questions

Does it work on pages that need JavaScript to load?
It downloads the page as the server delivers it. Content that only appears after scripts run in a browser may be missing. Most documentation, blogs and help centers render their text in the HTML and convert well, but test one page first.
Is it all right to copy a website like this?
Check the site's terms and robots.txt before saving pages you do not own, and keep the request volume modest. It is intended for your own sites and for reference copies of public pages, not for republishing other people's content.
How are the Drive files named?
Each file is named from the page address or title, such as help-center-billing.md, so the same page always maps to the same file and gets updated each week. Tell your AI assistant if you prefer folders that mirror the URL path.
What permissions does it need?
write (drive.file). Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it runs (weekly). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Archive a website to Drive as Markdown” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.