URL 'special character' replacements

Richie Hindle richie at entrian.com
Mon Jan 9 14:11:45 CET 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