Answers for "get all titles of twitch channel"

1

get all titles of twitch channel

from selenium import webdriver
from selenium.webdriver.common.keys import Keys

def twitchTitleNames(chanelName : str):
    # link to web driver DOWNLOAD FROM: 
    # [https://chromedriver.chromium.org/downloads] 
    # download for your version of your browser
    driver = webdriver.Chrome(executable_path=r'D:\Downloads2\chromedriver_win32 (1)\chromedriver.exe')  
    url = 'https://www.twitch.tv/' + chanelName + '/videos?filter=archives&sort=time'

    driver.get(url)

    searchinput = driver.find_elements_by_class_name('CoreText-sc-cpl358-0')

    titles = []
    for element in searchinput:
        strLink = str(element.get_attribute('title'))
        if strLink != '':
            titles.append(strLink.strip())

    for title in titles:
        print(title)


twitchTitleNames("shroud")
Posted by: Guest on October-01-2021

Python Answers by Framework

Browse Popular Code Answers by Language