[英]Is there any way to bypass Hcaptcha by using selenium python
bypassing is sadly not an option.遗憾的是,绕过不是一种选择。 What you want to do is to retrieve a solution from sites like 2captcha, while having the solution you need to find the element with the name "h-captcha-response" and edit it so it is visible, after that you need to write the solution of your captcha and submit the form.
您想要做的是从 2captcha 之类的网站检索解决方案,同时拥有您需要找到名称为“h-captcha-response”的元素并对其进行编辑以使其可见的解决方案,之后您需要编写您的验证码的解决方案并提交表格。
driver.execute_script("document.getElementByName('h-recaptcha-response').style = 'width: 250px; height: 40px; border: 1px solid rgb(193, 193, 193); margin: 10px 25px; padding: 0px;';")
driver.find_element(By.XPATH,'//*[@id="h-recaptcha-response"]').send_keys(recaptcha_solution)
this is a code I had laying around from another site, but it should make the h-captcha-response show up in your case as well, you need to find the XPATH of the element afterwards and write your own response and click the submit button.这是我从另一个站点放置的代码,但它也应该使 h-captcha-response 出现在您的情况下,您需要在之后找到元素的 XPATH 并编写您自己的响应并单击提交按钮.
If the code doesn't work try to find the h-recaptcha-response in the HTML and see if it is on the name or the ID of the element, this example assumes it has this name but it is also possible that it is on the ID, in that case you should use如果代码不起作用,请尝试在 HTML 中查找 h-recaptcha-response 并查看它是否在元素的名称或 ID 上,此示例假定它具有此名称,但也可能在ID,在这种情况下你应该使用
driver.execute_script("document.getElementById('h-recaptcha-response').style = 'width: 250px; height: 40px; border: 1px solid rgb(193, 193, 193); margin: 10px 25px; padding: 0px;';")
While automating Captcha is not the best practice, there are three efficient ways of handling Captcha in Selenium:虽然自动化验证码不是最佳实践,但在 Selenium 中处理验证码有三种有效的方法:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.