I'm developing a captcha solver using IBM Watson and all is well, I just need to save the playing audio to a file which can be then resolved using watson. I don't know how to go about that and I didn't find anything here. If possible I don't want some complicated requests etc, just save the playing audio to a file. Or download the audio, but I tried using chrome_options to set download location, but it just didn't work Any help will be really appreciated
my code:
import os
import time
import random
import requests
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from multiprocessing import Process
import ibm_watson
from ibm_watson import SpeechToTextV1
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
from ibm_watson.websocket import RecognizeCallback, AudioSource
chrome_options = Options()
chrome_options.add_argument("--mute-audio")
chrome_options.add_argument ("download.default_directory=/home/valentino/")
driver = webdriver.Chrome(options=chrome_options)
apikeywatson = 'C2f79A8ENbeUmWw-1DwTMd_v4IgCdCjqKpx21PsRaKan'
urlwatson = 'https://api.eu-de.speech-to-text.watson.cloud.ibm.com/instances/9a22253e-7fc5-4c67-b85b-5ad54db8282d'
authibm = IAMAuthenticator(apikeywatson)
stt = SpeechToTextV1(authenticator=authibm)
stt.set_service_url(urlwatson)
driver.get('https://client-demo.arkoselabs.com/github')
time.sleep(4)
WebDriverWait(driver, 10).until(EC.frame_to_be_available_and_switch_to_it((By.CSS_SELECTOR, "iframe[src^='https://client-api.arkoselabs.com/fc/gc/']")))
time.sleep(2)
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "span[class='fc_meta_audio_btn']"))).click()
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.ID, "audio_play"))).click()