本站改版新增arduino频道
获取url链接主域名
def get_urlhost(url): urlinfo = url.split('/', 3) host = '' path = '' for i in range(4): if i >= len(urlinfo): break if i == 2: host = urlinfo[2] if i == 3: path = urlinfo[3] hostinfo = host.split(':') if len(hostinfo) > 1: port = int(hostinfo[-1]) host = hostinfo[0] return host
Copyright © 2014 ESP56.com All Rights Reserved
晋ICP备14006235号-22 晋公网安备14108102001165号
执行时间: 0.0095400810241699 seconds