说明 |
---|
每个网站都不一样,如果以下方式都不能解决问题,烦请您自己多研究研究,您可以的。 |
...
代码块 |
---|
grecaptcha.ready(function() { grecaptcha.execute('6LdpS-gUAAAAAL3Qr2yP7rkrQjkKBVvEY_48JS5l', {action: 'login'}).then(function(token) { }); }); |
...
如果网页中搜索不到,则可能是js被混肴、加密了,需要尝试其他方式如果网页中搜索不到,则可能是js被混肴、加密了,需要尝试其他方式:
请参照这个单独的教程:如何找reCaptchaV3的action值
第三种:通过自动识别函数获取参数
打开出现验证码的网页,按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() |
...