« URL structure & normalization

The <base> tag

This page lives at /scraping/url-structure/base-tag, but its <head> sets <base href="https://testingurl.dev/scraping/">, one directory level above where the page actually is. Every relative link and image on the page resolves against that base, not the page's own URL. A scraper that resolves relative links against the page URL while ignoring <base> computes the wrong target.

This link's raw href attribute is just ecommerce:

ecommerce

Resolved against this page's own URL, that would be /scraping/url-structure/ecommerce (doesn't exist). Resolved correctly against <base>, it's /scraping/ecommerce, the real store front. Follow the link and see where it actually goes.