from urllib.parse import urlparse url = 'http://www.chenxm.cc/post/719.html' res = urlparse(url).netloc print(res)