Scrape SEO Metadata

# List of URLs to scrape
urls <- c(
  "https://usa.mizuno.com/",
  "https://www.saucony.com/en/home",
  "https://www.nike.com"
)

clean_value <- function(x) {
  if (length(x) == 0 || all(is.na(x))) return(NA_character_)
  x <- str_squish(as.character(x[1]))
  if (!nzchar(x)) NA_character_ else x
}

collapse_tags <- function(page, selector) {
  values <- page %>%
    html_elements(selector) %>%
    html_text2() %>%
    str_squish()

  values <- values[nzchar(values)]
  if (length(values) == 0) NA_character_ else str_c(unique(values), collapse = " | ")
}

fetch_page <- function(url) {
  tryCatch({
    Sys.sleep(1.5) # polite delay between requests
    read_html(url)
  }, error = function(e) {
    structure(list(message = conditionMessage(e)), class = "scrape_error")
  })
}

scrape_one <- function(url) {
  page <- fetch_page(url)

  if (inherits(page, "scrape_error")) {
    message("Could not scrape ", url, ": ", page$message)
    return(tibble(
      url = url,
      title = NA_character_,
      meta_description = NA_character_,
      h1 = NA_character_,
      h2 = NA_character_,
      h3 = NA_character_,
      status = "failed",
      error = page$message
    ))
  }

  tibble(
    url = url,
    title = page %>% html_element("title") %>% html_text2() %>% clean_value(),
    meta_description = page %>% html_element("meta[name='description']") %>% html_attr("content") %>% clean_value(),
    h1 = collapse_tags(page, "h1"),
    h2 = collapse_tags(page, "h2"),
    h3 = collapse_tags(page, "h3"),
    status = "ok",
    error = NA_character_
  )
}

seo_data <- bind_rows(lapply(urls, scrape_one))
write.csv(seo_data, file = "seo_data.csv", row.names = FALSE)

Formatted Results

Page-Level SEO Summary

Page-level SEO metadata summary
Site Title Meta Description Status
usa.mizuno.com Mizuno USA | Sports Equipment, Clothing, and Gear Shop the Mizuno USA official website for all your sports equipment, footwear, apparel, and accessories for Running, Golf, Baseball, Volleyball, and much more! ok
saucony.com Running Shoes, Clothing, & Accessories | Saucony US Official Saucony Site - Shop high-performance running shoes & clothes for men and women. Gear designed for you to be your best. ok
nike.com Nike. Just Do It. Nike.com Inspiring the world’s athletes, Nike delivers innovative products, experiences and services. ok

Heading Tags

Instead of printing seo_data$h1, seo_data$h2, and seo_data$h3 as long console vectors, the table below splits each heading into its own readable row.

Readable heading-tag output
Site Level Item Heading
usa.mizuno.com H1 1 About Us
usa.mizuno.com H1 2 Support
usa.mizuno.com H1 3 Shopping
usa.mizuno.com H2 1 Footer Start
usa.mizuno.com H2 2 Join My MVP Rewards for member updates and benefits.
saucony.com H2 1 Final Sale
saucony.com H2 2 15% Off
saucony.com H2 3 Like being first?
saucony.com H2 4 Performance
saucony.com H2 5 Lifestyle
saucony.com H2 6 Elevate Your Run
saucony.com H2 7 Made for more
saucony.com H2 8 Push Your Comfort Zone
saucony.com H2 9 Find Your Comfort Zone
saucony.com H2 10 Your New Rotation
saucony.com H2 11 Introducing the all-new Endorphin Elite 3
saucony.com H2 12 Compare The Endorphin Collection
saucony.com H2 13 New Arrivals
saucony.com H2 14 Every Run Has A Purpose
saucony.com H2 15 PROGRID Ride 1
saucony.com H2 16 Kids
saucony.com H2 17 Join the Crew
saucony.com H2 18 Shoe Finder
saucony.com H2 19 Buyer’s Guide
saucony.com H2 20 Gift Cards
saucony.com H3 1 Free Shipping on Orders $75+
saucony.com H3 2 Don’t sweat it. Returns are free.
saucony.com H3 3 Did you mean?
saucony.com H3 4 Products
saucony.com H3 5 Your Recent Searches
saucony.com H3 6 Popular Searches
saucony.com H3 7 Categories
saucony.com H3 8 with ID.me Verification
saucony.com H3 9 Endorphin
saucony.com H3 10 Ride 19
saucony.com H3 11 Triumph 24
saucony.com H3 12 Guide 19
saucony.com H3 13 Hurricane 26
saucony.com H3 14 Paramount Max
saucony.com H3 15 ProGrid Omni 9
saucony.com H3 16 ProGrid Guide 7
saucony.com H3 17 ProGrid Triumph 4
saucony.com H3 18 Ride Millennium
saucony.com H3 19 Trainer 80
saucony.com H3 20 Endorphin Elite 3
saucony.com H3 21 Daily Trainer Endorphin Azura
saucony.com H3 22 Premium Race Endorphin Pro 5
saucony.com H3 23 Race and Train Endorphin Speed 5
saucony.com H3 24 Pro Performance Endorphin Elite 3
saucony.com H3 25 Women’s Endorphin Azura
saucony.com H3 26 Men’s Endorphin Azura
saucony.com H3 27 ViZiRed Collection
saucony.com H3 28 ProGrid Ride 1
saucony.com H3 29 Still Loyal
saucony.com H3 30 The original running brand
saucony.com H3 31 Popular Links
saucony.com H3 32 My Account
saucony.com H3 33 Resources
saucony.com H3 34 Models
nike.com H2 1 Run Free, Play Forever
nike.com H2 2 Nike Vapor Edge 360 “Untouchable”
nike.com H2 3 Lock In. Level Up.
nike.com H2 4 TRENDING
nike.com H2 5 Africa
nike.com H2 6 Americas
nike.com H2 7 Asia Pacific
nike.com H2 8 Europe
nike.com H2 9 Middle East
nike.com H3 1 ROWING STRONG
nike.com H3 2 HIS LEGEND LIVES ON
nike.com H3 3 IRRATIONAL BELIEF
nike.com H3 4 THREE LION HEARTED
nike.com H3 5 SWEAT. PROOF.
nike.com H3 6 ACG Radical AirFlow
nike.com H3 7 Play outside the lines with Nike Free Ride’s flexible innovation, now in fresh new colors.
nike.com H3 8 The cleat that took the world by storm, modernized with our greatest innovations.
nike.com H3 9 Nothing sweet About it
nike.com H3 10 A Striking Approach
nike.com H3 11 One on Anyone
nike.com H3 12 Practice Ready
nike.com H3 13 First Day Footwear
nike.com H3 14 Classroom Ready
nike.com H3 15 Bring serious style to their everyday game.
nike.com H3 16 FULL HORSEPOWER

Compact Heading Counts

Number of headings collected by site and heading level
Site H2 H3 H1
nike.com 9 16 0
saucony.com 20 34 0
usa.mizuno.com 2 0 3

Some Thoughts on SEO

Across the three shoe brands, all three title tags clearly identify the brand, but they use different SEO positioning strategies. - Mizuno takes the broadest approach by emphasizing sports equipment, clothing, footwear, and gear, which gives it wide category coverage. Saucony is more focused on running shoes and performance apparel, making its search intent clearer for a specific running audience. - Nike relies more on brand recognition with its short “Just Do It” title, while the meta description expands the message toward innovation, products, experiences, and services. - Saucony has the most product-specific SEO language, Mizuno has the broadest category language, and Nike has the strongest brand-first positioning.