“Überprüfen Sie, ob String -URL -Python” Code-Antworten

Überprüfen Sie, ob String -URL -Python

# pip install validators
>>> import validators
>>> validators.url("https://google.com")
True
>>> validators.url("https://google"):
False
Temerold

Python -Überprüfung, ob die Zeichenfolge URL ist

from django.core.validators import URLValidator()
validate = URLValidator()

try:
    validate("http://www.avalidurl.com/")
    print("String is a valid URL")
except ValidationError as exception:
    print("String is not valid URL")
Real Raccoon

Ähnliche Antworten wie “Überprüfen Sie, ob String -URL -Python”

Fragen ähnlich wie “Überprüfen Sie, ob String -URL -Python”

Weitere verwandte Antworten zu “Überprüfen Sie, ob String -URL -Python” auf Python

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen