ParseUrl

#!/usr/bin/python
# coding:utf-8

import re
import urlparse

# 解析url
def ParseUrl(url):
    if not re.search(r"^http[s]?://",url):
        if ":443" in url:
            url = "https://" + url
        else:
            url = "http://" + url
        return url

 

posted @ 2014-04-26 23:00  r3call  阅读(187)  评论(0编辑  收藏  举报