{"id":16078118,"url":"https://github.com/alexwlchan/safari-webarchiver","last_synced_at":"2026-01-16T09:54:42.205Z","repository":{"id":240123612,"uuid":"801733672","full_name":"alexwlchan/safari-webarchiver","owner":"alexwlchan","description":"Save web pages as Safari webarchive files from the command line","archived":false,"fork":false,"pushed_at":"2025-01-23T23:27:11.000Z","size":53,"stargazers_count":133,"open_issues_count":4,"forks_count":8,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-24T00:23:42.811Z","etag":null,"topics":["safari","web-scraping","webarchives","webkit","wkwebview"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexwlchan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-16T20:08:55.000Z","updated_at":"2025-01-23T23:27:13.000Z","dependencies_parsed_at":"2024-05-20T22:27:56.313Z","dependency_job_id":"4d1994ab-d819-4a68-b28b-2472494d8c44","html_url":"https://github.com/alexwlchan/safari-webarchiver","commit_stats":null,"previous_names":["alexwlchan/safari-webarchiver"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexwlchan%2Fsafari-webarchiver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexwlchan%2Fsafari-webarchiver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexwlchan%2Fsafari-webarchiver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexwlchan%2Fsafari-webarchiver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexwlchan","download_url":"https://codeload.github.com/alexwlchan/safari-webarchiver/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237739846,"owners_count":19358624,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["safari","web-scraping","webarchives","webkit","wkwebview"],"created_at":"2024-10-09T10:07:34.076Z","updated_at":"2025-10-22T20:30:53.958Z","avatar_url":"https://github.com/alexwlchan.png","language":"Python","funding_links":[],"categories":["web-scraping"],"sub_categories":[],"readme":"# safari-webarchiver\n\nThis tool creates [Safari webarchive files](https://en.wikipedia.org/wiki/Webarchive) on the command line.\nThis gives you an offline archive of web pages, which can be stored and backed up independently of any cloud services.\n\n```console\n$ save_safari_webarchive \"https://example.com\" \"example.webarchive\"\n```\n\nThese archives are the same as those created by the `File \u003e Save As…` menu item, but now you can create them programatically and in bulk.\n\n## How it works\n\nIt opens the given URL in a `WKWebView`, calls `createWebArchiveData` to create a webarchive file, and saves it to disk.\nThat's the core workflow, and then there's a bunch of error handling around that.\n\nFor a more detailed explanation of this code, see \u003chttps://alexwlchan.net/2024/creating-a-safari-webarchive/\u003e\n\n## Installation\n\n### Install from source\n\n1.  Install the Xcode Command Line Tools\n2.  Download the `save_safari_webarchive.swift` script from this repo\n3.  Compile the script into a binary:\n\n    ```console\n    $ swiftc save_safari_webarchive.swift\n    ```\n\n4.  Copy the compiled binary `save_safari_webarchive` to somewhere in your PATH.\n\n### Install a compiled binary\n\n1.  Find the latest [GitHub release](https://github.com/alexwlchan/safari-webarchiver/releases)\n2.  Download the zip file which is appropriate for your system (Intel = `x86_64`, Apple Silion = `aarch64`)\n3.  Open the zip file, and add the `save_safari_webarchive` app to your PATH\n\nThe app is just a compiled version of the Swift script.\nIt isn't notarised, so when you run it, you may get a warning that this app is from an unidentified developer.\nYou can get around this by right-clicking the app icon in Finder, and choosing `Open` from the shortcut menu.\n\n## Usage\n\nRun the script passing two arguments: the URL you want to archive, and the path where you want to save the webarchive file.\n\nFor example, this command will save the URL to this GitHub repo to `safari-webarchiver.webarchive`:\n\n```console\n$ save_safari_webarchive \"https://github.com/alexwlchan/safari-webarchiver\" \"safari-webarchiver.webarchive\"\n```\n\n## Acknowledgements\n\nThis is partially inspired by [a similar script](https://github.com/newzealandpaul/webarchiver) written in 2008 by newzealandpaul.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexwlchan%2Fsafari-webarchiver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexwlchan%2Fsafari-webarchiver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexwlchan%2Fsafari-webarchiver/lists"}