Hola, estoy escribiendo un código de raspado web de selenio y quiero manejar un reproductor de video para detener y reproducir. Básicamente manejo el reproductor usando JS DOM ( .play() y .pause() ). El problema es que tengo un problema al raspar varios videos, como: raspo y manejo un video de url1 y cuando voy a url2, el video no se maneja
const myFunc = async (driver) => { await driver.executeScript('document.getElementsByTagName("video")[0].start()') await driver.executeScript(`document.getElementsByTagName("video")[0].currentTime = ${opening}`) const actions = driver.actions() await actions.move(driver.findElement(By.tagName('video'))).sendKeys('f').perform() const checkEnding = async () => { setTimeout(async () => { const currentTime = await driver.executeScript('return document.getElementsByTagName("video")[0].currentTime') const btns = await driver.findElements(By.xpath('/html/body/center/div[2]/footer/div[1]/div')) const btnNext = btns[btns.length - 1] console.log(SERVICE + (await btnNext.getAttribute('onclick')).replace("window.location.href='",'')) console.log(currentTime) if (currentTime >= ending) { driver.get(SERVICE + (await btnNext.getAttribute('onclick')).replace("window.location.href='",'')) myFunc(driver) } else checkEnding() }, 2E3) } checkEnding() }Depuré mucho este código y también intenté reproducirlo con un clic de acción, pero no pasó nada, también intenté ejecutar un script de prueba y también funciona.