How to convert a url string to safe characters with python?

后端 未结 3 1845
有刺的猬
有刺的猬 2020-12-10 11:48

Suppose I have the following string:

\"http://earth.google.com/gallery/kmz/women_for_women.kmz?a=large\"

Is there some function or module t

3条回答
  •  南笙
    南笙 (楼主)
    2020-12-10 12:12

    Are you looking for urllib.quote or urllib.quote_plus? Note that you do not quote the entire url string as you mentioned in the question. You normally quote the part in the path or after the query string. Whichever you are going to use in the application.

提交回复
热议问题