urljoin
urljoin is a function in Python's urllib.parse module that constructs an absolute URL by combining a base URL with a possibly relative URL. It follows RFC 3986 resolution rules: if the second URL is absolute, it is returned unchanged; otherwise it is resolved against the base. The function also normalizes path segments and can remove or add components as needed to produce a valid URL.
How it resolves details: if the relative URL starts with '/', it replaces the base path after the
Examples: urljoin('http://example.com/path/page.html', '../images/pic.jpg') yields 'http://example.com/images/pic.jpg'. urljoin('http://example.com/path/page.html', '/new') yields 'http://example.com/new'. If the relative URL is 'https://other.org/abs',
Usage context: urljoin is widely used in web crawling, scraping, and link normalization to convert relative