A URL (Uniform Resource Locator) is a web address that identifies a resource on the internet and specifies how to access it.
URLs are used to locate webpages, images, files, and API endpoints. They are essential for web browsing, HTTP communication, and automated data collection.
A URL is a type of Uniform Resource Identifier (URI).
When a user enters a URL into a browser, several operations take place:
The exact process depends on the URL scheme and resource type.
Consider this example:
https://shop.example.com:443/products?id=1001#reviews
| Component | Example | Purpose |
|---|---|---|
| Scheme | https |
Specifies the access protocol |
| Host | shop.example.com |
Identifies the destination server |
| Port | 443 |
Specifies the network port |
| Path | /products |
Identifies the requested resource |
| Query | id=1001 |
Provides additional parameters |
| Fragment | reviews |
Identifies a section within the resource |
Not every URL includes all these components.
URLs and URIs are related but not identical.
Every URL is a URI, but not every URI is a URL.
For example, a URN can identify a book using its ISBN without specifying where to retrieve it.
Example:
Absolute: https://example.com/products/1001
Relative: /products/1001
Relative URLs are commonly used for internal website navigation.
Query parameters and fragments serve different purposes.
For HTTP URLs, fragments are processed by the client and are not sent to the server as part of the request.
URLs determine which resources a web scraper retrieves.
A scraping application may extract links from HTML, follow pagination URLs, or modify query parameters to request different results.
Proper URL handling is important because relative paths, encoded characters, and duplicate URL variations can affect collection accuracy.
Scrapers should normalize URLs carefully and follow applicable website access rules.
Suppose an online store lists products across several pages:
https://example.com/products?page=1
https://example.com/products?page=2
https://example.com/products?page=3
A scraper can identify the page query parameter and request each permitted page to collect product listings.
The URL structure helps the application navigate the catalog systematically.
A URL is a standardized address that identifies an online resource and describes how to access it.
Understanding URL components, query parameters, and relative paths is essential for web development, API integration, SEO, and web scraping.