python 进行网址 URL 中的 % 转化
网址URL中,有很多%
,很难看出网址中的有用信息,如:get请求中,URL中的参数。通过 python3 的urllib
包,可以实现对URL中%
的转换。
import urllib.parse
url = "https://vws2019.lqqgis.com/portal/sharing/rest/search?num=100&start=1&sortField=modified&sortOrder=desc&q=%20owner%3A%22arcgis%22%20orgid%3A0123456789ABCDEF%20((type%3A%22Scene%20Service%22%20OR%20type%3A%22Feature%20Collection%22%20OR%20type%3A%22Route%20Layer%22%20OR%20type%3A%22Layer%22%20OR%20type%3A%22Explorer%20Layer%22%20OR%20type%3A%22Tile%20Package%22%20OR%20type%3A%22Compact%20Tile%20Package%22%20OR%20type%3A%22Vector%20Tile%20Package%22%20OR%20type%3A%22Scene%20Package%22%20OR%20type%3A%22Layer%20Package%22%20OR%20type%3A%22Feature%20Service%22%20OR%20type%3A%22Stream%20Service%22%20OR%20type%3A%22Feed%22%20OR%20type%3A%22Map%20Service%22%20OR%20type%3A%22Vector%20Tile%20Service%22%20OR%20type%3A%22Image%20Service%22%20OR%20type%3A%22WMS%22%20OR%20type%3A%22WFS%22%20OR%20type%3A%22WMTS%22%20OR%20type%3A%22KML%22%20OR%20typekeywords%3A%22OGC%22%20OR%20typekeywords%3A%22Geodata%20Service%22%20OR%20type%3A%22Globe%20Service%22%20OR%20type%3A%22CSV%22%20OR%20type%3A%22Shapefile%22%20OR%20type%3A%22GeoJson%22%20OR%20type%3A%22Service%20Definition%22%20OR%20type%3A%22File%20Geodatabase%22%20OR%20type%3A%22CAD%20Drawing%22%20OR%20type%3A%22Relational%20Database%20Connection%22)%20-type%3A(%22Web%20Mapping%20Application%22%20OR%20%22Geodata%20Service%22))%20%20ownerfolder%3A9d0cca432e9544c9b0c0cbfb8d619b99%20-type%3A(%22Code%20Attachment%22%20OR%20%22Featured%20Items%22)%20-typekeywords%3A(%22MapAreaPackage%22)%20-type%3A(%22Map%20Area%22)&categories=&f=json&token=MPt1x_xzciuC0Dmq0ILZjJNvltXXNHiJo75-YdWy8eK50uFOke7cA5K_5lV3iNRw0wHWd1fvxD-SA1C8P1J9OqRW_QteQGNhessZ4DLtRX0_Zk7WcZ0XYPOg-1-TdHyWoJvlwQ6LW4c_EH9HT9i5piLQw1JOX2D7SDJ5VFiNm6eRcug24Wj42MlCGr8-KeHcIHJjiE4GjTKzvxMRuujZQg.."
_de_code= urllib.parse.unquote(url)
print(_de_code)
https://vws2019.lqqgis.com/portal/sharing/rest/search?num=100&start=1&sortField=modified&sortOrder=desc&q= owner:"arcgis" orgid:0123456789ABCDEF ((type:"Scene Service" OR type:"Feature Collection" OR type:"Route Layer" OR type:"Layer" OR type:"Explorer Layer" OR type:"Tile Package" OR type:"Compact Tile Package" OR type:"Vector Tile Package" OR type:"Scene Package" OR type:"Layer Package" OR type:"Feature Service" OR type:"Stream Service" OR type:"Feed" OR type:"Map Service" OR type:"Vector Tile Service" OR type:"Image Service" OR type:"WMS" OR type:"WFS" OR type:"WMTS" OR type:"KML" OR typekeywords:"OGC" OR typekeywords:"Geodata Service" OR type:"Globe Service" OR type:"CSV" OR type:"Shapefile" OR type:"GeoJson" OR type:"Service Definition" OR type:"File Geodatabase" OR type:"CAD Drawing" OR type:"Relational Database Connection") -type:("Web Mapping Application" OR "Geodata Service")) ownerfolder:9d0cca432e9544c9b0c0cbfb8d619b99 -type:("Code Attachment" OR "Featured Items") -typekeywords:("MapAreaPackage") -type:("Map Area")&categories=&f=json&token=MPt1x_xzciuC0Dmq0ILZjJNvltXXNHiJo75-YdWy8eK50uFOke7cA5K_5lV3iNRw0wHWd1fvxD-SA1C8P1J9OqRW_QteQGNhessZ4DLtRX0_Zk7WcZ0XYPOg-1-TdHyWoJvlwQ6LW4c_EH9HT9i5piLQw1JOX2D7SDJ5VFiNm6eRcug24Wj42MlCGr8-KeHcIHJjiE4GjTKzvxMRuujZQg..
分类:
Python
, ArcGIS Enterprise
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· winform 绘制太阳,地球,月球 运作规律
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人