其中URL parsing function pair我应该使用,为什么?
-
urlparse
和urlunparse
, 或 -
urlsplit
和urlunsplit
?
最佳答案
直接来自 the docs you linked yourself :
urllib.parse.urlsplit(urlstring, scheme='', allow_fragments=True)
This is similar tourlparse()
, but does not split the params from the URL. This should generally be used instead ofurlparse()
if the more recent URL syntax allowing parameters to be applied to each segment of the path portion of the URL (see RFC 2396) is wanted.
关于python - 我应该使用哪个 : urlparse or urlsplit?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5472160/