Beritau 3 weeks ago
admin #coding

Dig Domain WHois

Whois Domain Last Version

import whois

def get_specific_whois_data(domain):
    try:
        whois_data = whois.whois(domain)
        data_to_extract = {
            "domain_name": domain,
            "registrar": whois_data.registrar if hasattr(whois_data, 'registrar') else "N/A",
            "expiration_date": whois_data.expiration_date[0].strftime("%Y-%m-%d") if (hasattr(whois_data, 'expiration_date') and isinstance(whois_data.expiration_date, list)) else whois_data.expiration_date.strftime("%Y-%m-%d") if (hasattr(whois_data, 'expiration_date') and whois_data.expiration_date is not None) else "N/A",
            "name_servers": ", ".join(whois_data.name_servers) if (hasattr(whois_data, 'name_servers') and isinstance(whois_data.name_servers, (list, tuple))) else "N/A"
        }
        return data_to_extract
    except whois.parser.PywhoisError:
        print(f"Error getting WHOIS for {domain}. Skipping...")
        return None

# Read domains from list.txt
with open("list.txt", "r") as file:
    domains = [line.strip() for line in file]

# Process domains and update files
processed_domains = []
for domain in domains:
    result = get_specific_whois_data(domain)
    if result:
        with open("results.txt", "a") as file:
            file.write(f"{result['domain_name']}, {result['registrar']}, {result['expiration_date']}, {result['name_servers']}\n")
        processed_domains.append(domain)
    
    # Remove processed domains from list.txt
    with open("list.txt", "w") as file:
        for remaining_domain in set(domains) - set(processed_domains):
            file.write(remaining_domain + "\n")

print("WHOIS lookup completed.")


Bagaimana memulai membuat web

Bagaimana memulai membuat web

1711409835.png
Beritau
2 weeks ago
video

Cara membuat Google Drive API

admin
Beritau
3 weeks ago
Amankan Situs WordPress Anda

Amankan Situs WordPress Anda

1711409835.png
Beritau
3 weeks ago
40 Ide Nama Robot

40 Ide Nama Robot

1711409835.png
Beritau
3 weeks ago
Bagaimana cara embuat site yg support google discover

Bagaimana cara embuat site yg support google discover

1711409835.png
Beritau
2 weeks ago