![](/img/trans.png)
[英]Is there any way to bypass Google proxy block in Selenium webdriver?
[英]Is there any way to bypass Hcaptcha by using selenium python
遺憾的是,繞過不是一種選擇。 您想要做的是從 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)
這是我從另一個站點放置的代碼,但它也應該使 h-captcha-response 出現在您的情況下,您需要在之后找到元素的 XPATH 並編寫您自己的響應並單擊提交按鈕.
如果代碼不起作用,請嘗試在 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;';")
雖然自動化驗證碼不是最佳實踐,但在 Selenium 中處理驗證碼有三種有效的方法:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.