How to urlencode() an URL in Python3

Posted on March 2, 2020 at 12:50 pm

To urlencode() an URL in Python3 you can use urllib.parse:

import urllib.parse
 
print(urllib.parse.quote("http://www.sample.com/"))

Example result:

http%3A%2F%2Fwww.sample.com%2F

Receive updates via email

Other Posts

Updated Posts