【问题标题】:How to click on the Hcaptcha using puppeteer-extra如何使用 puppeteer-extra 点击 Hcaptcha
【发布时间】:2022-07-29 20:43:23
【问题描述】:

我正在使用 puppeteer-extra 并尝试点击 recaptcha,但我在谷歌两天找不到解决方案 我尝试了不止一种方法,但没有奏效 我希望它使用 puppeteer 自动单击复选框

我的问题不在于解决验证码,我的问题在于点击其复选框

This is iframe Selector :
#app-mount > div.app-1q1i1E > div > div > div > section > div > div.flexCenter-3_1bcw.flex-1O1GKY.justifyCenter-3D2jYp.alignCenter-1dQNNs > div > iframe
This is iframe :
<iframe src="https://newassets.hcaptcha.com/captcha/v1/f9bf301/static/hcaptcha-checkbox.html#id=29x2xvbwuudm&amp;host=discord.com&amp;sentry=true&amp;reportapi=https%3A%2F%2Faccounts.hcaptcha.com&amp;recaptchacompat=true&amp;custom=false&amp;hl=en&amp;tplinks=on&amp;sitekey=f5561ba9-8f1e-40ca-9b5b-a0b3f719ef34&amp;theme=dark" title="widget containing checkbox for hCaptcha security challenge" tabindex="0" frameborder="0" scrolling="no" data-hcaptcha-widget-id="29x2xvbwuudm" data-hcaptcha-response="" style="width: 303px; height: 78px; overflow: hidden;"></iframe>
--------
This is checkbox :
<div id="checkbox" aria-haspopup="true" aria-checked="false" role="checkbox" tabindex="0" aria-live="assertive" aria-labelledby="a11y-label" style="position: absolute; width: 28px; height: 28px; border-width: 1px; border-style: solid; border-color: rgb(245, 245, 245); border-radius: 4px; background-color: rgb(250, 250, 250); top: 0px; left: 0px;"></div>
await page.waitForFunction(`#app-mount > div.app-1q1i1E > div > div > div > section > div > 
div.flexCenter-3_1bcw.flex-1O1GKY.justifyCenter-3D2jYp.alignCenter-1dQNNs > div > iframe`)

await page.click(`#checkbox`),

【问题讨论】:

标签: javascript css-selectors puppeteer captcha hcaptcha


【解决方案1】:

您的选择器似乎是错误的。 当 hcaptcha 启动时,它会生成随机的类名(哈希),因此您无法在您的机器上尝试、获取类名并将其投入生产,因为每次执行都是不同的类名。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-08-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-06-22
    • 2021-12-31
    • 2019-07-01
    • 1970-01-01
    相关资源
    最近更新 更多