Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python unescape URL

Tags:

python

url

I have got a url in this form - http:\\/\\/en.wikipedia.org\\/wiki\\/The_Truman_Show. How can I make it normal url. I have tried using urllib.unquote without much success.

I can always use regular expressions or some simple string replace stuff. But I believe that there is a better way to handle this...

like image 514
Srikar Appalaraju Avatar asked Dec 03 '22 10:12

Srikar Appalaraju


1 Answers

urllib.unquote is for replacing %xx escape codes in URLs with the characters they represent. It won't be useful for this.

Your "simple string replace stuff" is probably the best solution.

like image 60
Angus Avatar answered Dec 20 '22 12:12

Angus