Toggle navigation
Home
Latest pastes
FAQ
Random
Register
Login
Python how to split a domain with urlparse
SUBMITTED BY:
alemotta
DATE:
April 13, 2017, 9:16 p.m.
FORMAT:
Text only
SIZE:
187 Bytes
Raw
Download
Tweet
HITS:
594
Go to comments
Report
#Python how to split a domain with urlparse
import urlparse
url = "http://python.org"
domain = urlparse.urlsplit(url)[1].split(':')[0]
print "The domain name of the url is: ", domain
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus