Selenium Python script but am having trouble locating the skip ads button

robifz

Newbie
Joined
Dec 15, 2023
Messages
9
Reaction score
2
I am writing a Selenium Python script but am having trouble locating the skip ads button. I
am using this and it does not work.

skip_ad = wait.until(EC.element_to_be_clickable((By.XPATH, "//*[@id='skip-button:6']/span/button")))
skip_ad.click()

also tried this
skip_ad = wait.until(EC.element_to_be_clickable((By.CLASS_NAME, "ytp-ad-skip-button")))
skip_ad.click()
 
Back
Top