Skip to content

Instantly share code, notes, and snippets.

@Helw150
Created July 13, 2017 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Helw150/9a0868f6ce9fce56d6f944612ea35584 to your computer and use it in GitHub Desktop.
Save Helw150/9a0868f6ce9fce56d6f944612ea35584 to your computer and use it in GitHub Desktop.
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