Last active
July 19, 2024 00:53
-
-
Save marz-hunter/0eff7e2f2eafcffab44916ec92bf1c68 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import io | |
import tldextract | |
def extract(infile): | |
with io.open(infile, encoding='utf-8') as f: | |
for line in f: | |
domain = line.strip('\n') | |
extracted = tldextract.extract(domain) | |
if extracted.registered_domain: | |
print("{}".format(extracted.registered_domain)) | |
if __name__ == '__main__': | |
infile = input('Masukkan nama file input: ') | |
extract(infile) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment