Created
July 13, 2017 18:18
-
-
Save Helw150/9a0868f6ce9fce56d6f944612ea35584 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def brand_from_url(url): | |
domain_list = urlparse(url).netloc.split('.') | |
if(len(domain_list) < 3): | |
brand= domain_list[0] | |
else: | |
brand = domain_list[1] | |
return brand |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment