Sub topic 6
Using web archives to see what the dead page covered
This chapter assumes you can read HTTP status codes, know how a broken link is found (covered earlier), and have run a short Python script with requests and BeautifulSoup.
Why look at the old page
A 404 tells you the link is dead. It doesn't tell you what the link promised. Your outreach should offer a replacement that fits the original topic. If the dead page was a 2019 pricing comparison and you offer a general introduction, the site owner has no reason to swap it in.
A web archive stores copies of pages as they looked on past dates. The Internet Archive's Wayback Machine is the most widely used one. Its copies are called snapshots.
Find a snapshot by hand
- Open
https://web.archive.org/web/*/followed by the dead URL. - Pick a snapshot from a date when the page returned a normal 200 response. Snapshots of error pages or redirects are common, so check a few.
- Note the title, the headings, the main claims, and any data or tools on the page.
- Check the anchor text the linking site used. It shows how the owner described the page.
Find a snapshot with a script
The Wayback Machine has an availability API. It returns the snapshot closest to a date you give. This script fetches that snapshot and prints its title and headings.
import requests
from bs4 import BeautifulSoup
API = "https://archive.org/wayback/available"
HEADERS = {"User-Agent": "link-audit/1.0"}
def summarize_dead_page(dead_url, timestamp="2022", timeout=15):
resp = requests.get(
API,
params={"url": dead_url, "timestamp": timestamp},
headers=HEADERS,
timeout=timeout,
)
closest = resp.json().get("archived_snapshots", {}).get("closest")
if not closest or not closest.get("available"):
return None
# "id_" after the timestamp returns the original HTML without the archive toolbar
snap = closest["url"].replace(
"/web/" + closest["timestamp"], "/web/" + closest["timestamp"] + "id_"
)
html = requests.get(snap, headers=HEADERS, timeout=timeout).text
soup = BeautifulSoup(html, "html.parser")
return {
"snapshot": closest["url"],
"title": soup.title.get_text(strip=True) if soup.title else "",
"headings": [h.get_text(strip=True) for h in soup.find_all(["h1", "h2"])],
}
if __name__ == "__main__":
print(summarize_dead_page("example.com/old-guide"))The function returns None when nothing was archived. Handle that case instead of assuming a snapshot exists.
Common errors
- Using the wrong snapshot. The closest snapshot may be a redirect, a parked domain, or a soft 404. Read the content before you trust it.
- Assuming the page never changed. The page may have changed between snapshots. Compare an early and a late one if the topic seems to have shifted.
- Copying the old content. Archived text is still someone else's work. Use it to understand the topic, then write or choose your own resource.
- Hitting rate limits. Add a short delay between requests when you check many URLs.
What to record
For each dead URL, save four items in your prospect sheet: the snapshot link, the original topic, the format (guide, tool, study, list), and the year. The next chapter uses these notes to decide whether an existing page of yours fits or whether you need to create a new one.
Exercise
A snapshot of a dead URL shows only a "This domain is for sale" page. What should you do next?
Show answer
Treat the snapshot as unusable. Try an earlier snapshot from before the domain lapsed. If none is useful, infer the topic from the anchor text and the sentence around the link on the linking page.
Exercise
Why does the script insert "id_" after the timestamp in the snapshot URL?
Show answer
It makes the Wayback Machine return the original archived HTML without the archive's toolbar and rewritten links, so the parser sees the page's real title and headings.