From 977b4e9837238cfedeb27f9a1b997c9f4227a8d1 Mon Sep 17 00:00:00 2001 From: Paul McMonagle Date: Sat, 9 May 2020 18:56:51 -0400 Subject: [PATCH] Added paper-item to transcript button CSS selector Updated a selenium command to reflect changes to the structure of the YouTube page: paper-item > yt-formatted-string --- captions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/captions.py b/captions.py index bd079bd..a4d3572 100644 --- a/captions.py +++ b/captions.py @@ -56,7 +56,7 @@ def gettranscript(videoid): return msg try: - element = WebDriverWait(driver, waittime).until(EC.presence_of_element_located((By.CSS_SELECTOR, "#items > ytd-menu-service-item-renderer:nth-child(2) > yt-formatted-string"))) #items > ytd-menu-service-item-renderer:nth-child(2) > yt-formatted-string + element = WebDriverWait(driver, waittime).until(EC.presence_of_element_located((By.CSS_SELECTOR, "#items > ytd-menu-service-item-renderer:nth-child(2) > paper-item > yt-formatted-string"))) #items > ytd-menu-service-item-renderer:nth-child(2) > paper-item > yt-formatted-string except: msg = 'could not find transcript in options menu' driver.quit() @@ -105,4 +105,4 @@ def logit(id,msg): msg = gettranscript(row[colname]) logit(row[colname],msg) rowcount -= 1 - print(str(rowcount) + " : " + row[colname] + " : " + msg) \ No newline at end of file + print(str(rowcount) + " : " + row[colname] + " : " + msg)