# 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)
| 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 |
| Site | H2 | H3 | H1 |
|---|---|---|---|
| nike.com | 9 | 16 | 0 |
| saucony.com | 20 | 34 | 0 |
| usa.mizuno.com | 2 | 0 | 3 |
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.