Skip to content

Instantly share code, notes, and snippets.

@kazazakifire
Created May 24, 2020 23:32
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 kazazakifire/c23519526c5e69ab9ad462d555515180 to your computer and use it in GitHub Desktop.
Save kazazakifire/c23519526c5e69ab9ad462d555515180 to your computer and use it in GitHub Desktop.
URL domain parser
url = "https://www.makeuseof.com/tag/browser-text-based-games/"
fullStopIndex = url.find('.')
forwardSlashIndex = url[fullStopIndex:].find('/')
domain = url[fullStopIndex + 1:fullStopIndex + forwardSlashIndex]
print(domain)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment