如何在 Python 中取消编码? [英] How do I url unencode in Python?

查看:34
本文介绍了如何在 Python 中取消编码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

鉴于此:
It%27s%20me%21

取消编码并将其转换为常规文本?

Unencode it and turn it into regular text?

推荐答案

看看 urllib.unquoteurllib.unquote_plus.那将解决您的问题.虽然从技术上讲,url编码"是使用 & 将参数传递到 url 的过程.和 ?字符(例如 www.foo.com?x=11&y=12).

Take a look at urllib.unquote and urllib.unquote_plus. That will address your problem. Technically though url "encoding" is the process of passing arguments into a url with the & and ? characters (e.g. www.foo.com?x=11&y=12).

这篇关于如何在 Python 中取消编码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆