zoukankan      html  css  js  c++  java
  • urllib2.unquote解码url字符串

    Type "help", "copyright", "credits" or "license" for more information.
    >>> import urllib2
    >>> import urllib
    >>> a="http://share.xiaonei.com/share/buttonshare.do?link=http://www.quwan.com/tuan/deals/deals.php?t_c=i_20101218_a_684022&title=%E6%8E%A8%E8%8D%90%E8%B6%A3%E5%9B%A2%E4%BB%8A%E6%97%A5%E5%9B%A2%E8%B4%AD&send_message=%E6%8E%A8%E8%8D%90%E8%B6%A3%E5%9B%A2%E4%BB%8A%E6%97%A5%E5%9B%A2%E8%B4%AD%EF%BC%9A%E9%80%81%E5%A5%B3%E5%8F%8B%2129.9%E5%85%83%21%E5%B8%82%E5%9C%BA%E4%BB%B764%E5%85%83%E8%8A%AD%E6%AF%94%E4%BF%9D%E6%9A%96%E5%AE%B6%E5%B1%85%E9%9E%8B%21+%E9%80%8F%E6%B0%94%E9%98%B2%E8%87%AD%E4%BF%9D%E6%9A%96%E6%80%A7%E5%BC%BA%EF%BC%8C%E9%98%B2%E6%BB%91%E8%80%90%E7%A3%A8%E4%B8%8D%E4%BC%A4%E5%9C%B0%E6%9D%BF%EF%BC%8C%E8%AE%A9%E5%AE%B6%E5%85%85%E6%BB%A1%E6%B8%A9%E6%9A%96%E8%89%B2%E5%BD%A9%21"
    >>> urllib2.unquote(a)
    'http://share.xiaonei.com/share/buttonshare.do?link=http://www.quwan.com/tuan/deals/deals.php?t_c=i_20101218_a_684022&title=\xe6\x8e\xa8\xe8\x8d\x90\xe8\xb6\xa3\xe5\x9b\xa2\xe4\xbb\x8a\xe6\x97\xa5\xe5\x9b\xa2\xe8\xb4\xad&send_message=\xe6\x8e\xa8\xe8\x8d\x90\xe8\xb6\xa3\xe5\x9b\xa2\xe4\xbb\x8a\xe6\x97\xa5\xe5\x9b\xa2\xe8\xb4\xad\xef\xbc\x9a\xe9\x80\x81\xe5\xa5\xb3\xe5\x8f\x8b!29.9\xe5\x85\x83!\xe5\xb8\x82\xe5\x9c\xba\xe4\xbb\xb764\xe5\x85\x83\xe8\x8a\xad\xe6\xaf\x94\xe4\xbf\x9d\xe6\x9a\x96\xe5\xae\xb6\xe5\xb1\x85\xe9\x9e\x8b!+\xe9\x80\x8f\xe6\xb0\x94\xe9\x98\xb2\xe8\x87\xad\xe4\xbf\x9d\xe6\x9a\x96\xe6\x80\xa7\xe5\xbc\xba\xef\xbc\x8c\xe9\x98\xb2\xe6\xbb\x91\xe8\x80\x90\xe7\xa3\xa8\xe4\xb8\x8d\xe4\xbc\xa4\xe5\x9c\xb0\xe6\x9d\xbf\xef\xbc\x8c\xe8\xae\xa9\xe5\xae\xb6\xe5\x85\x85\xe6\xbb\xa1\xe6\xb8\xa9\xe6\x9a\x96\xe8\x89\xb2\xe5\xbd\xa9!'
    >>> print _
    http://share.xiaonei.com/share/buttonshare.do?link=http://www.quwan.com/tuan/deals/deals.php?t_c=i_20101218_a_684022&title=推荐趣团今日团购&send_message=推荐趣团今日团购:送女友!29.9元!市场价64元芭比保暖家居鞋!+透气防臭保暖性强,防滑耐磨不伤地板,让家充满温暖色彩!
    >>> 
  • 相关阅读:
    使用asp.net core 3.0 搭建智能小车1
    Exceptionless—本地部署
    SQLserver2016对字段是json对象查询
    Hello,World!
    计算机网络(一)
    《Unity Shader入门精要》读书笔记(抄1)
    模仿不知道哪个版本的AppleWatch界面UI(wpf)
    仿制shazzam的简单功能,将hlsl转换为WPF中的ShaderEffect
    CAST()函数可以进行数据类型的转换。
    ORA-00984: 列在此处不允许 SQL parse error location
  • 原文地址:https://www.cnblogs.com/lexus/p/1910601.html
Copyright © 2011-2022 走看看