Skip to content

Instantly share code, notes, and snippets.

@bongbongco
Last active October 20, 2016 23:48
Show Gist options
  • Save bongbongco/286cf49298bef46f579b96358848ac0c to your computer and use it in GitHub Desktop.
Save bongbongco/286cf49298bef46f579b96358848ac0c to your computer and use it in GitHub Desktop.
import sys
import re
def ExtractDomain(fullUrl):
domainRegex = re.compile("(http[s]?|ftp):\/\/([a-z0-9-]+\.)+[a-z0-9]{2,4}")
extractDomain = domainRegex.search(fullUrl)
print extractDomain.group()
return extractDomain.group()
def favicon(domain):
favicon = "/favicon.ico"
faviconUrl = domain + favicon
print faviconUrl
return faviconUrl
def main():
domain = ExtractDomain("http://www.naver.com/test/ttest/test.html")
faviconUrl = favicon(domain)
if __name__ == "__main__":
main()
sys.exit(0)
@bongbongco
Copy link
Author

도메인 추출 후 아이콘 URL로 만들기

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment