from urllib.parse import urlparse
url = 'https://seek4info.com/search.php?query=python'
parsed = urlparse(url)
print(parsed)
print(parsed.scheme)
print(parsed.netloc)
print(parsed.path)
print(parsed.params)
print(parsed.query)
print(parsed.fragment)
print(parsed.hostname)
print(parsed.port)
'''
run:
ParseResult(scheme='https', netloc='seek4info.com', path='/search.php', params='', query='query=python', fragment='')
https
seek4info.com
/search.php
query=python
seek4info.com
None
'''