From 7e38ddcf49057554b945dd8a2a93a5b4edb14f37 Mon Sep 17 00:00:00 2001 From: Lluis Date: Sat, 2 Mar 2024 16:50:00 +0100 Subject: [PATCH] redorder wait selector --- helpers/browserApi.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers/browserApi.js b/helpers/browserApi.js index 0eaac36..504e8fd 100644 --- a/helpers/browserApi.js +++ b/helpers/browserApi.js @@ -31,11 +31,11 @@ class PuppeteerApi { } async removeElementsAndGetDiv() { + await this.page.waitForSelector('div.persistent-player') await this.page.$eval('button[data-a-target="consent-banner-accept"]', el => el.click()).catch(() => {}) await this.page.$eval('#twilight-sticky-footer-root', el => el.remove()).catch(() => {}) await this.page.$eval('button[data-a-target="content-classification-gate-overlay-start-watching-button"]', el => el.click()).catch(() => {}) await this.page.$eval('button[data-a-target="right-column__toggle-collapse-btn"]', el => el.click()).catch(() => {}) - await this.page.waitForSelector('div.persistent-player') await this.page.$eval('.video-player__default-player', el => el.remove()) }