简体   繁体   English

调用 Hcaptcha 回调 function 的问题

[英]Problem to call Hcaptcha callback function

I come to see you because I have been blocking for a week to send the hcaptcha response to Google.我来看你是因为我已经阻止了一周将 hcaptcha 回复发送给 Google。

To put it in context, I'm developing a web automation program in Python with Selenium at releases.footshop.com website.为了把它放在上下文中,我正在 Python 中开发一个 web 自动化程序,Selenium 在发布.footshop.ZBC50D236D9ADDA2 网站。
The captcha is at the end of the forms and should activate the "Finish your order" button验证码位于 forms 的末尾,应激活“完成您的订单”按钮

I manage to retrieve the response to the hcaptcha sent by 2 captcha, then put it in the h-captcha textbox.我设法检索到 2 验证码发送的对 hcaptcha 的响应,然后将其放入 h-captcha 文本框中。 But impossible to send it.但是无法发送。

According to the hcaptcha documentation, the callback function is called in the POST request.根据 hcaptcha 文档,在 POST 请求中调用了回调 function。 I have bein found this function, it is hcaptchaOnLoad: https://hcaptcha.com/1/api.js?render=explicit&onload=hcaptchaOnLoad我发现这个 function,它是 hcaptchaOnLoad: https://hcaptcha.com/1/api.js?render=explicit&onload=hcaptchaOnLoad

I also found the index.js file where the hcaptcha function is defined and where hcaptchaOnLoad is called.我还找到了 index.js 文件,其中定义了 hcaptcha function 以及调用 hcaptchaOnLoad 的位置。 https://pastebin.com/8MZb0P0B 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;
    });
  };

I enclose the tests that I was able to do in the Chrome console and Firefox as well as my 2captcha code.我附上了我能够在 Chrome 控制台和 Firefox 以及我的 2captcha 代码中进行的测试。

Chrome tests铬测试

Firefox tests Firefox 测试

Python code Python代码

Regards,问候,
Mart市场

Try this.may helps https://2captcha.com/blog/hcaptcha-cloudflare-en With their addon, i can bypass the hcaptcha But the callback function name keep changing So i'm not able to call it in code.试试这个。可以帮助https://2captcha.com/blog/hcaptcha-cloudflare-en使用他们的插件,我可以绕过 hcaptcha 但是回调 function 名称不断变化所以我无法在代码中调用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM