import urllib proto, rest = urllib.splittype("http://www.75271.com/11/12.htm") host, rest = urllib.splithost(rest) print host host, port = urllib.splitport(host) if port is None: port = 80 print port
import urllib proto, rest = urllib.splittype("http://www.75271.com/11/12.htm") host, rest = urllib.splithost(rest) print host host, port = urllib.splitport(host) if port is None: port = 80 print port