murl是python模块urlparse的一个小包装器。
murl的Python项目详细描述
项目详细信息
安装
使用pip安装:
$ pip install murl
开始
注意
详细的文档可以在http://murl.rtfd.org/上找到。
from murl import Url url = Url('https://bugzilla.mozilla.org/show_bug.cgi?id=698201#c0') print url.scheme, url.host, url.querystring, url.fragment # https bugzilla.mozilla.org id=698201 c0 url.scheme = 'http' url.host = 'bugzilla.webkit.org' print url print url.url print url.scheme print url.host print url.netloc print url.host == url.netloc # http://bugzilla.webkit.org/show_bug.cgi?id=698201#c0 # http://bugzilla.webkit.org/show_bug.cgi?id=698201#c0 # http # bugzilla.webkit.org # bugzilla.webkit.org # True url.path = 'list_bugs.cgi' print url.path, url.url # list_bugs.cgi http://bugzilla.webkit.org/list_bugs.cgi?id=698201#c0 url.fragment = 'c1' print url.fragment print url.url # c1 # http://bugzilla.webkit.org/list_bugs.cgi?id=698201#c1 url.fragment = '' print url.fragment print url.url # '' # http://bugzilla.webkit.org/list_bugs.cgi?id=698201
许可证
作为本项目一部分的所有文件都包含在以下许可证中, 除非明确注明。
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.