0
我的大脑正在受伤。我试图验证来自Google reCaptcha 2.0的验证码,但它表示验证码不正确(解决更多问题)。它始终发生在100%,我从来没有从Selenium那里获得过验证码。Selenium - reCaptcha表示验证码错误(但它没有错!)| Python | PhantomJS
看到的那样,例如在这样的画面: clicking reCaptcha picture
后来,当我点击 “确认” - 键,那么这happend: reCatpcha Error
我的Python代码:
self.driver.switch_to.frame(capcthaframe)
picturetable = self.driver.find_element_by_css_selector('.rc-imageselect-table-3')
images = []
for row in picturetable.find_elements_by_tag_name('tr'):
for col in row.find_elements_by_tag_name('td'):
images.append(col.find_element_by_tag_name('img'))
if images == []:
self.fail("Found no captcha images")
return -1
print "[*] Got answer : " + str(numbers)
for number in numbers:
index = int(number)-1
images[index].click()
print '[+] clicked on image '+str(index+1)
self.driver.save_screenshot('res.png')
time.sleep(1)
verifybutton = self.driver.find_element_by_id('recaptcha-verify-button')
verifybutton.click()
print "[*] Clicked verify button"
time.sleep(10)
我不认为我的代码是错的...所以,有谁知道这个reCaptcha错误有什么问题?我希望有人能帮助我! :)
谢谢
- 约翰
附:我使用带硒和PhantomJS的树莓派。所有的作品除了在此验证码错误细... :(
您正在尝试自动化CAPTCHA?你显然不明白CAPTCHA是什么! – SiKing
@SiKing不,我正在使用2Captcha解决人类解决reCaptcha问题。我了解CAPTCHA是什么。 ;) –
你使用自己的PhantomJS实现,还是使用Detro的Ghostdriver?我猜测Ghostdriver,在这种情况下,这可能对你很有趣:https://github.com/detro/ghostdriver#help-needed – SiKing