python

python提取根域名

#!/usr/bin/python # -*- coding: UTF-8 -*- import re def getDomain(s): res = s domainS = [".com",".cn",".com.cn",".gov",".net",".edu.cn",".net.cn",".org.cn",".co.jp",".gov.cn",".co.uk","a...