href = WebDriverWait(self.driver, self.timeout).until(
EC.element_to_be_clickable((By.XPATH, '//a[@title="Скачать MP3-файл"]'))).get_attribute("href")
urllib.request.urlretrieve(href, os.getcwd() + "\\audio_recaptcha.mp3")
sound = pydub.AudioSegment.from_mp3('audio_recaptcha.mp3')
sound.export('audio_recaptcha.wav', format="wav")
sample_audio = sr.AudioFile('audio_recaptcha.wav')
r = sr.Recognizer()
with sample_audio as source:
audio = r.record(source)
key = r.recognize_google(audio)
driver.find_element(By.ID, "audio-response").send_keys(key.lower() + Keys.ENTER)
driver.switch_to.default_content()