Use urllib.parse instead of urlparse module for Python 3