如何使AntiCaptcha与selenium python中的outlook注册帐户一起工作?

2024-07-03 08:13:02 发布

您现在位置:Python中文网/ 问答频道 /正文

我想在selenium webdriver中创建outlook帐户。我有所有的脚本,但验证码解算不起作用。有什么办法可以让它发挥作用吗?这是我的代码的一部分,它解决了文本验证码,但现在它是带有旋转动物的FunCaptcha。我只是不知道如何在scirpt中实现这种类型的验证码。API等是集成的。提前谢谢

       `birthY.click()
        birthY.send_keys(str(indexy))
        self.driver.find_element_by_id("iSignupAction").click()
        wait(5)
        img = self.driver.find_elements_by_tag_name("img")[0]
        src = img.get_attribute('src')
        filename = str(int(time.time())) + ".png"
        urlretrieve(src, filename)
        file = open(filename, 'rb')
        wait(0.5)
        client = AnticaptchaClient(self.ac_token)
        task = ImageToTextTask(file)
        job = client.createTask(task)
        print("Submitting Captcha")
        job.join()
        cap = job.get_captcha_text()
        file.close()
        os.remove(filename)
        wait(0.5)
        self.driver.find_element_by_tag_name("input").send_keys(cap)
        wait(3)
        self.driver.find_element_by_id("iSignupAction").click()
        print("{}@outlook.com:{}:{}".format(username, self.user_password, country))`

Tags: selfsrcimgbydriverjobelementfind