Skip to content

extracts the domain name from a URL using tldextract library in python

Notifications You must be signed in to change notification settings

sumgr0/extract-domain-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

The python script to extract domain names from a URL list, while ensuring the TLD being intact.

It'll strip any sub-domain or path from the URL and creates a new file with the unique domain list.

The script required the TLDextract library by John, for Python 3. More on the library and details at https://github.com/john-kurkowski/tldextract

Command to install: pip install tldextract

Usage:

  • $chmod +x domain.py
  • $./domain.py <input_file> <output_file>

Notes:

  • The input files must contain one URL in each line

Enjoy!!

About

extracts the domain name from a URL using tldextract library in python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages