python - 我应该使用哪个 : urlparse or urlsplit?

标签 python urllib urlparse urlsplit

其中URL parsing function pair我应该使用,为什么?

最佳答案

直接来自 the docs you linked yourself :

urllib.parse.urlsplit(urlstring, scheme='', allow_fragments=True)
This is similar to urlparse(), but does not split the params from the URL. This should generally be used instead of urlparse() 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/

相关文章:

python - 如何监控/记录 sqlalchemy 范围内的 session ?

python - Flask 应用程序退出时如何停止 Gunicorn

python - 如何在数据仍在传输时从 http 响应 python 获得部分结果?

python - 我如何克服 Python http.client.HTTPResponse 对象?

rest - 如何让客户端接受服务器的SSL证书

python - 在 Python 2 中修改 URL 组件

python - gethostbyaddr() 在 Python 3 中引发 UnicodeDecodeError

python - tensorflow 2.x : Cannot save trained model in h5 format (OSError: Unable to create link (name already exists))

python - 找到 http ://and or www. 并从域中剥离。离开 domain.com

python - 从 url 解析查询部分