Python模块学习---Web

import urlparse
url = urlparse.urlparse("http://www.python.org/doc/FAQ.html")
print url
print urlparse.urlunparse(url)

运行结果:

ParseResult(scheme='http', netloc='www.python.org', path='/doc/FAQ.html', params='', query='', fragment='')
http://www.python.org/doc/FAQ.html

 

posted @ 2017-07-05 19:45  蒋励  阅读(126)  评论(0编辑  收藏  举报