Peut analyser l'URL
slimurl.py
# -*- coding: utf-8 -*-
from slimurl import URL
url = URL('http://example.net')
print ("%r" % url)
# <URL "http://example.net/">
print ((url.host, url.port, url.scheme))
# ('example.net', 80, 'http')
print (URL('http://example.net') == URL('http://example.net/'))
# True
print (URL('http://example.net:80') == URL('http://example.net/'))
# True
print (URL('http://example.net') == URL('http://example.net/?foo=bar'))
# False
Recommended Posts