URL 'special character' replacements

Richie Hindle richie at entrian.com
Mon Jan 9 08:11:45 EST 2006


[Claude]
> I have a huge list of URLs. These URLs all have ASCII codes for special
> characters, like "%20" for a space or "%21" for an exclamation mark.

You need urllib.unquote:

>>> import urllib
>>> help(urllib.unquote)
Help on function unquote in module urllib:

unquote(s)
    unquote('abc%20def') -> 'abc def'.

-- 
Richie Hindle
richie at entrian.com



More information about the Python-list mailing list