说明 |
---|
每个网站都不一样,如果以下方式都不能解决问题,烦请您自己多研究研究,您可以的。 |
目录 |
---|
第一种:通过浏览器控制台Network发送的请求获取参数
打开包含的网页,按F12->Network,
1、搜索关键词anchor
websiteKey
:可以在URL中找到,例如以下链接中k值为6LfW6wATAAAAAHLqO2pb8bDBahxlMxNdo9g947u9
...
代码块 |
---|
referer: https://recaptcha-demo.appspot.com/ |
...
2、获取 pageAction 值
reCaptcha v3
需要action值,而且必须正确,通过网页源代码中搜索关键词 grecaptcha
...
如果网页中搜索不到,则可能是js被混肴、加密了,需要尝试其他方式
第三种:通过自动识别函数获取参数
打开出现验证码的网页,按F12键,进入console,
输入自定义函数findRecaptchaClients()
执行
不会操作的,下面有张图
代码块 |
---|
function findRecaptchaClients() { // eslint-disable-next-line camelcase if (typeof (___grecaptcha_cfg) !== 'undefined') { // eslint-disable-next-line camelcase, no-undef return Object.entries(___grecaptcha_cfg.clients).map(([cid, client]) => { const data = { id: cid, version: cid >= 10000 ? 'V3' : 'V2' }; const objects = Object.entries(client).filter(([_, value]) => value && typeof value === 'object'); objects.forEach(([toplevelKey, toplevel]) => { const found = Object.entries(toplevel).find(([_, value]) => ( value && typeof value === 'object' && 'sitekey' in value && 'size' in value )); if (typeof toplevel === 'object' && toplevel instanceof HTMLElement && toplevel['tagName'] === 'DIV'){ data.pageurl = toplevel.baseURI; } if (found) { const [sublevelKey, sublevel] = found; data.sitekey = sublevel.sitekey; const callbackKey = data.version === 'V2' ? 'callback' : 'promise-callback'; const callback = sublevel[callbackKey]; if (!callback) { data.callback = null; data.function = null; } else { data.function = callback; const keys = [cid, toplevelKey, sublevelKey, callbackKey].map((key) => `['${key}']`).join(''); data.callback = `___grecaptcha_cfg.clients${keys}`; } } }); return data; }); } return []; } findRecaptchaClients() |
...