Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from selenium import webdriver
- name = [] # Array for channel names
- link = [] # Array for channel links
- logo = [] # Array fpr channel logos
- # Chrome driver path and background option
- options = webdriver.ChromeOptions()
- options.add_argument('headless')
- chrome_path = r'C:\Users\aleex\Desktop\driver\chromedriver.exe'
- driver = webdriver.Chrome(chrome_path,options=options)
- driver.get('https://www.ontvtonight.com/ie/guide/')
- # Increment for array assigment
- j = 0
- # Loop for finding web elements
- for i in driver.find_elements_by_class_name('channelname'):
- split = i.text.split('\n')[0]
- href = driver.find_element_by_link_text(split)
- name.append(split)
- link.append(href.get_attribute('href'))
- print(name[j])
- print(link[j])
- j = j + 1
- #Closing the chrome driver
- driver.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement