I'm trying to skip blacklisted items when working with my Selenium Python program, but I can't figure out how to make this snippet work -
channel = driver.find_element_by_xpath('/html/body/ytd-app/div[1]/ytd-page-manager/ytd-watch-flexy/div[3]/div[1]/div/div[7]/div[3]/ytd-video-secondary-info-renderer/div/div[2]/ytd-video-owner-renderer/a').get_attribute('aria-label')
print(channel)
print(blacklistchannels[3])
if channel in blacklistchannels:
print('Blacklisted Channel, Skipping...')
continue
else:
print('There is still a problem')
Even though when printed, the the channel name and blacklisted item (3) are exactly the same. It still follows the else, and prints out "there is still a problem"
Any help would be greatly appreciated, thanks!
Edit - The continue there is irrelevant to the snippet, it's just for continuing a loop this is in.
Solution - .Stripping() the blacklist and Channel name, to get rid of the whitespaces and /n I had for the newlines.