Skip to content

Commit

Permalink
simplify get_domain() code
Browse files Browse the repository at this point in the history
  • Loading branch information
BurnzZ committed Jan 26, 2024
1 parent 27a0044 commit a866976
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions zyte_spider_templates/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@


def get_domain(url: str) -> str:
allowed_domain = parse_url(url).netloc
allowed_domain = re.sub(r"www.*?\.", "", allowed_domain)
return allowed_domain
return re.sub(r"www.*?\.", "", parse_url(url).netloc)

0 comments on commit a866976

Please sign in to comment.