1from urllib.parse import urlparse
2
3domain = urlparse('http://www.example.test/foo/bar').netloc
4print(domain) # --> www.example.test
1from urllib.parse import urlparse
2domain = urlparse('https://supermavster.com').netloc
1url_list = ['https://blog.hubspot.com/marketing/parts-url',
2 'https://www.almabetter.com/enrollments',
3 'https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.rename.html',
4 'https://www.programiz.com/python-programming/list']