我来看你是因为我已经阻止了一周将 hcaptcha 回复发送给 Google。
为了把它放在上下文中,我正在releases.footshop.com网站上使用Selenium在Python中开发一个网络自动化程序。
验证码位于表格末尾,应激活“完成您的订单”按钮
我设法检索到 2 验证码发送的对 hcaptcha 的响应,然后将其放入 h-captcha 文本框中。但是无法发送。
根据 hcaptcha 文档,回调函数是在 POST 请求中调用的。我找到了这个功能,它是 hcaptchaOnLoad: https ://hcaptcha.com/1/api.js?render=explicit&onload=hcaptchaOnLoad
我还找到了定义 hcaptcha 函数和调用 hcaptchaOnLoad 的 index.js 文件。https://pastebin.com/8MZb0P0B
// Generate hCaptcha API Script
var CaptchaScript = function CaptchaScript(hl, reCaptchaCompat) {
// Create global onload callback
window.hcaptchaOnLoad = function () {
// Iterate over onload listeners, call each listener
onLoadListeners = onLoadListeners.filter(function (listener) {
listener();
return false;
});
};
我附上了我能够在 Chrome 控制台和 Firefox 以及我的 2captcha 代码中进行的测试。
问候,
市场