You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import validators
url = 'msn.comm'
if (validators.domain(url)) or (validators.url(url)):
print("VALIDATION PASSED")
else:
print("Please insert a domain name in this format: example.com")
The validator merely checks that the subject is a valid domain syntactically - it does not have a list of valid TLDs nor does it attempt to resolve the domain. Syntactically 'msn.comm' is valid (as is 'fdsfds.fsaf.asfdsa.fdsa.fsdfsa.fsadfsa', for example).
It is validating the format just as many validators do (the email validator doesn't send an email to make sure the account exists). I would agree that it would be nice to have it check against a list of TLDs. Perhaps the maintainer could pull from here regularly:
Activity
jbnance commentedon Dec 11, 2017
The validator merely checks that the subject is a valid domain syntactically - it does not have a list of valid TLDs nor does it attempt to resolve the domain. Syntactically 'msn.comm' is valid (as is 'fdsfds.fsaf.asfdsa.fdsa.fsdfsa.fsadfsa', for example).
lameei commentedon Dec 12, 2017
This is weird. So what is the propose of validation here?
jbnance commentedon Dec 12, 2017
It is validating the format just as many validators do (the email validator doesn't send an email to make sure the account exists). I would agree that it would be nice to have it check against a list of TLDs. Perhaps the maintainer could pull from here regularly:
https://data.iana.org/TLD/tlds-alpha-by-domain.txt