-
URL
A URL (Uniform Resource Locator), more commonly known as a “web address”, specifies the location of a resource (such as a web page) on the internet.
The URL also specifies how to retrieve that resource, also known as the “Protocol”, such as HTTP, HTTPS, FTP, etc.
A URL is a specific type of Uniform Resource Identifier (URI).
The URI generic syntax consists of a hierarchical sequnce of five components:
URI = scheme:[//authority]path[?query][#fragment]where the authority component divides into three subcomponents:
authority=[useinfo@]host[:port] -
urllib
-
urllib.parse.rulparse(urlstring, scheme='', allow_fragments=True)Parse a URL into six components, returing a 6-item names tuple. This correspons to the general structure of a URL :
scheme://netloc/path;parameters?query#fragment -
urllib.parse.parse_qs(qs, keep_blank_values=False, strict_parsing=False, encoding='utf-8', errors='replace', max_num_fields=None)Parse a query string given as a string argument. Data are returned as a dictionary.
-
References
理解urllib.parse in Python||URL结构
最新推荐文章于 2026-05-16 09:14:09 发布
本文介绍了URL(统一资源定位符)的基本概念及其组成部分,包括如何指定互联网上的资源位置及检索方式。文中还详细解释了URL的语法结构,并通过Python的urllib库演示了URL解析的方法。

1100

被折叠的 条评论
为什么被折叠?



