Is there a way to URL decode a string in Python 3
to take something like this
id%253D184ff84d27c3613d%26quality%3Dmedium
and decode it twice to get
id=184ff84d27c3613d&quality=medium
replace('%20+', '') will replace '%20+' with empty string.
Just use urllib.parse.unquote()
:
>>> import urllib.parse >>> urllib.parse.unquote('id%253D184ff84d27c3613d%26quality%3Dmedium') 'id%3D184ff84d27c3613d&quality=medium' >>> urllib.parse.unquote('id%3D184ff84d27c3613d&quality=medium') id=184ff84d27c3613d&quality=medium
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With