【发布时间】:2021-10-19 15:45:59
【问题描述】:
我有 hcaptcha 复选框的 HTML 如下:
<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(145, 145, 145); border-radius: 4px; background-color: rgb(250, 250, 250); top: 0px; left: 0px;"></div>
我尝试了以下命令但没有成功:
check = driver.find_element_by_id("checkbox")
driver.execute_script("arguments[0].click();",check)
返回错误:
selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable
以下一些命令也不起作用:
driver.find_element_by_xpath('//*[@id="checkbox"]').click()
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "/html/body/div/div[1]/div[1]/div"))).click()
此链接:https://gleam.io/gIxR1/cyball-x-ancient8-20-common-packs-cyblocs-1000-usdt-social-giveaways
如何解决这个问题?
【问题讨论】:
-
你能分享页面网址吗
-
如何导航到该复选框?
-
你需要连接到twitter并点击task follow twitter
-
可能会检查 iframe,因为大多数验证码都加载了 iframe