python - 提交 2captcha 令牌后页面重新加载
问题描述
我正在尝试使用 selenium 在 Twitter 上注册并使用 2captcha API 来解决验证码,但是由于某种原因,当单击继续时页面刷新并且没有继续
captchaInput = twitter_driver.find_element_by_id('g-recaptcha-response')
print("Text area set to visible")
twitter_driver.execute_script("arguments[0].setAttribute('style','display:visible;');", captchaInput)
time.sleep(5)
print("Entering captcha token")
captchaInput.send_keys(captcha_token)
time.sleep(5)
button_click = "javascript:document.getElementById('continue_button').click();"
twitter_driver.execute_script(button_click)
解决方案
如果您使用 Python 编写代码,请尝试这样做
wait.until(EC.element_to_be_clickable((By.CSS_SELECTOR, '#your selector'))).click()
如果您不尝试更详细地描述错误
推荐阅读
- javascript - 在 React 中处理对一个巨大的 10 列表进行排序的最佳方法?
- c# - 如何使用 ToShortDateString 拼出月份?
- python - ValueError:检查目标时出错:预期dense_3的形状为(1,)但得到的数组形状为(2,)keras
- html - 如何使png文件成为html中的按钮
- ios - 为什么 Progress.fractionCompleted 超过 1.0?
- php - CakePHP 在 Null 上调用成员函数 query()
- python - 如何找到过滤数据的标准偏差(groupby)
- ios - 对 FetchedRC 进行分区(单元格的自定义顺序)
- java - Builder 模式中的嵌套泛型类型:如何实现和避免类型擦除(ascii 树、图片)
- reactjs - React 组件中的 transitionstart 事件