python提取url中的域名和端口号
import urllib proto, rest = urllib.splittype("http://www.open-open.com/") host, rest = urllib.splithost(rest) print host host, port = urllib.splitport(host) if port is None: port = 80 print port
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/8311.html