虫术 虫术
首页
目录
  • 国内验证码

    • 顶象 DING XIANG
    • 数美 NEXTDATA
    • 易盾 NETEASE YIDUN
    • 极验 GEETEST
    • 阿里云云盾验证码
    • 腾讯天御 T-Sec
    • 小红书 redCaptcha
    • 小盾 XIAODUN
    • 云片 YUNPIAN
    • 三六零天御
    • 螺丝帽 Luosimao
    • Vaptcha
    • V5 验证
    • 凯格 KYGER
    • 友验 FastYotest
  • 国外验证码

    • Cloudflare Turnstile
    • Google reCAPTCHA
    • hCaptcha
    • Arkose Labs FunCAPTCHA
    • DataDome CAPTCHA
    • PerimeterX丨HUMAN Challenge
    • AWS (Amazon) WAF Captcha
    • MTCaptcha
    • Lemin CAPTCHA丨Capy Puzzle
    • Yandex SmartCaptcha
    • mCaptcha
    • KeyCAPTCHA
    • CyberSiARA
    • Friendly Captcha
    • ARCaptcha
    • CaptchaFox
  • 辅助脚本

    • JS Hook
    • Frida API
    • babel
  • 命令查询

    • Linux 命令
    • ADB 命令
    • ARM 指令集
    • Dalvik 指令集
  • 指纹信息

    • CreepJS
    • Fingerprint2
    • 自动化工具检测
  • 加密算法

    • URL
    • Unicode
    • Base64
    • MD5
    • HMAC
    • SHA
    • RSA
    • AES
    • DES
    • 3DES
    • RC4
    • SM
  • 基本请求

    • Python
  • 异步协程

    • asyncio
    • gevent
  • 多线程

    • threading
    • vthread
  • 多进程

    • multiprocessing
  • 自动化框架

    • selenium
    • pyppeteer
    • playwright
    • splash
    • DrissionPage
    • appium
    • airtest
  • 接口编写

    • FastAPI
    • flask
    • express
  • 爬虫框架

    • scrapy
    • feapder
    • pyspider
  • 数据提取

    • re
    • lxml
    • BeautifulSoup
    • pyquery
    • selectolax
  • 数据分析

    • wordcloud
    • jieba
    • pandas
    • NumPy
    • SciPy
  • 制表绘图

    • matplotlib
    • pyecharts
    • plotly
    • seaborn
  • 数据存储

    • 文件存储
    • MySQL
    • MongoDB
    • Redis
    • SQLite
悟空风控
赞助
GitHub (opens new window)
首页
目录
  • 国内验证码

    • 顶象 DING XIANG
    • 数美 NEXTDATA
    • 易盾 NETEASE YIDUN
    • 极验 GEETEST
    • 阿里云云盾验证码
    • 腾讯天御 T-Sec
    • 小红书 redCaptcha
    • 小盾 XIAODUN
    • 云片 YUNPIAN
    • 三六零天御
    • 螺丝帽 Luosimao
    • Vaptcha
    • V5 验证
    • 凯格 KYGER
    • 友验 FastYotest
  • 国外验证码

    • Cloudflare Turnstile
    • Google reCAPTCHA
    • hCaptcha
    • Arkose Labs FunCAPTCHA
    • DataDome CAPTCHA
    • PerimeterX丨HUMAN Challenge
    • AWS (Amazon) WAF Captcha
    • MTCaptcha
    • Lemin CAPTCHA丨Capy Puzzle
    • Yandex SmartCaptcha
    • mCaptcha
    • KeyCAPTCHA
    • CyberSiARA
    • Friendly Captcha
    • ARCaptcha
    • CaptchaFox
  • 辅助脚本

    • JS Hook
    • Frida API
    • babel
  • 命令查询

    • Linux 命令
    • ADB 命令
    • ARM 指令集
    • Dalvik 指令集
  • 指纹信息

    • CreepJS
    • Fingerprint2
    • 自动化工具检测
  • 加密算法

    • URL
    • Unicode
    • Base64
    • MD5
    • HMAC
    • SHA
    • RSA
    • AES
    • DES
    • 3DES
    • RC4
    • SM
  • 基本请求

    • Python
  • 异步协程

    • asyncio
    • gevent
  • 多线程

    • threading
    • vthread
  • 多进程

    • multiprocessing
  • 自动化框架

    • selenium
    • pyppeteer
    • playwright
    • splash
    • DrissionPage
    • appium
    • airtest
  • 接口编写

    • FastAPI
    • flask
    • express
  • 爬虫框架

    • scrapy
    • feapder
    • pyspider
  • 数据提取

    • re
    • lxml
    • BeautifulSoup
    • pyquery
    • selectolax
  • 数据分析

    • wordcloud
    • jieba
    • pandas
    • NumPy
    • SciPy
  • 制表绘图

    • matplotlib
    • pyecharts
    • plotly
    • seaborn
  • 数据存储

    • 文件存储
    • MySQL
    • MongoDB
    • Redis
    • SQLite
悟空风控
赞助
GitHub (opens new window)
bright data bright data

(进入注册为作者充电)

  • 辅助脚本

    • JS Hook
    • Frida API
    • Babel
  • 命令查询

    • Linux 命令
    • ADB 命令
    • ARM 指令集
    • Dalvik 指令集
  • 指纹信息

    • CreepJS
    • Fingerprint2
    • 自动化工具检测
  • 加密算法

    • URL
      • Python
      • JavaScript
      • Golang
      • 主要特征
      • 在线工具
    • Unicode
    • Base64
    • MD5
    • HMAC
    • SHA
    • RSA
    • AES
    • DES
    • 3DES
    • RC4
    • SM
目录

URL

关于 URL 编码

URL 编码,又称为百分号编码(英语:Percent-encoding),是一种浏览器用来打包表单输入的格式,浏览器从表单中获取所有的 name 和其中的值 ,将它们以 name/value 参数编码(移去那些不能传送的字符,将数据排行等等)作为 URL 的一部分或者分离地发给服务器。

URL 编码维基百科 (opens new window)

注意

不同语言在处理 URL 编码时,对一些特殊符号的处理方式可能不一样,当发现编码结果与预期不一致时,请检查对特殊符号的处理。

# Python 3.0+

from urllib import parse

url = "https://spiderapi.cn/bob是大帅哥/"
url_encoded = parse.quote(url, safe="")  # safe 参数默认值为 /,用于指定不需要进行编码的字符
url_decoded = parse.unquote(url_encoded)

print("URL 编码值:", url_encoded)  # https%3A%2F%2Fspiderapi.cn%2Fbob%E6%98%AF%E5%A4%A7%E5%B8%85%E5%93%A5%2F
print("URL 解码值:", url_decoded)
1
2
3
4
5
6
7
8

# JavaScript Node.js ECMAScript 5.1+

/*
* encodeURICompoent() 与 encodeURI() 方法不同。它们的主要区别在于:
* encodeURICompoent():假定参数是 URI 的一部分,如协议、主机名、路径等,因此它将转义这些分隔 URI 各个部分的标点符号;
* encodeURI():仅把这些标点符号视为普通的 ASCII 字符,并没有转换。
*/


var url = "https://spiderapi.cn/bob是大帅哥/";

var urlEncoded = encodeURI(url);
var urlDecoded = decodeURI(urlEncoded);
var urlEncodedComponent = encodeURIComponent(url);
var urlDecodedComponent = decodeURIComponent(urlEncodedComponent);

console.log("URL 编码值:", urlEncoded);                    // https://spiderapi.cn/bob%E6%98%AF%E5%A4%A7%E5%B8%85%E5%93%A5/
console.log("URL Component 解码值:", urlEncodedComponent); // https%3A%2F%2Fspiderapi.cn%2Fbob%E6%98%AF%E5%A4%A7%E5%B8%85%E5%93%A5%2F

console.log("URL 编码值:", urlDecoded);
console.log("URL Component 解码值:", urlDecodedComponent);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

# Golang 1.0+

package main

import (
    "fmt"
    "net/url"
)

func main() {
    uri := "https://spiderapi.cn/bob是大帅哥/"
  
    urlEncoded := url.QueryEscape(uri)
    urlDecoded, err := url.QueryUnescape(urlEncoded)
    if err != nil {
        fmt.Println("Error decoding URL:", err)
        return
    }
    
    fmt.Println("URL 编码值:", urlEncoded) // https%3A%2F%2Fspiderapi.cn%2Fbob%E6%98%AF%E5%A4%A7%E5%B8%85%E5%93%A5%2F
    fmt.Println("URL 解码值:", urlDecoded)
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

# 主要特征

另外有一种叫做 Hex 编码的,和 URL 编码的结果是类似的,不同的是当你用 URL 编码网址时是不会把 http、https 关键字和 /、?、&、= 等连接符进行编码的,而 Hex 编码则全部转化了,二者主要特征如下:

以 % 开头,后面是数字加字母组合

编码类型 示例
明文 https://spiderapi.cn/
Unicode https%3A%2F%2Fspiderapi.cn%2F
Hex %68%74%74%70%73%3a%2f%2f%73%70%69%64%65%72%61%70%69.%63n%2f

# 在线工具

https://tool.chinaz.com/tools/urlencode.aspx (opens new window)

帮助我们改善此页 (opens new window)
上次更新: 2025/04/22, 14:38:07
自动化工具检测
Unicode

← 自动化工具检测 Unicode→

ICP 备案 鄂ICP备19003281号-9丨 MPS 公网安备 鄂公网安备42280202422959丨 Theme by Vdoing Theme Vdoing丨 Tencent EdgeOne Tencent EdgeOne丨 51la 网站统计

Copyright © 2023 - 2025 WuKong Security.丨 正在载入网站运行时间...丨
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式