The DomainExtractor.py
script is designed to extract the main domain from a list of subdomains. It handles different scenarios based on the length of the TLDs and the presence of ccTLDs. The script intelligently differentiates between longer TLDs (more than 4 characters) and combinations of TLDs and ccTLDs that total up to 5 characters, applying specific logic to ensure accurate domain extraction.
- Extracts main domains from a provided list of subdomains.
- Supports special handling for TLDs longer than 4 characters and ccTLD combinations up to 5 characters.
- Reads subdomains from a text file, processing each line as a separate entry.
Ensure you have Python installed on your system. This script was developed with Python 3.x in mind.
-
Prepare a text file containing your subdomains, one per line. For example,
subdomains.txt
. -
Run the script from the command line or terminal, passing the path to your subdomains file as an argument:
python DomainExtractor.py -file list.txt