Well, this is not so difficult to implement with urlparse in the standard library:
from urlparse import urlparse, parse_qs def urlEq(url1, url2): pr1 = urlparse(url1) pr2 = urlparse(url2) return (pr1.scheme == pr2.scheme and pr1.netloc == pr2.netloc and pr1.path == pr2.path and parse_qs(pr1.query) == parse_qs(pr2.query))
Basically, compare everything that is parsed from the URL, but use parse_qs to get the dictionary from the query string.
source share