Как проверить URL-адрес в Python? (Неправильно сформирован или нет)Python

Программы на Python
Anonymous
Как проверить URL-адрес в Python? (Неправильно сформирован или нет)

Сообщение Anonymous »


I have url from the user and I have to reply with the fetched HTML.

How can I check for the URL to be malformed or not?

For example :
url = 'google' # Malformed url = 'google.com' # Malformed url = 'http://google.com' # Valid url = 'http://google' # Malformed

Источник: https://stackoverflow.com/questions/716 ... med-or-not

Вернуться в «Python»