Click Twitch Avatar of offline user? selenium

  python, selenium

how would I click the avatar of someone who is offline in twitch? If you go to someone who is offline and then click their avatar it will take you to their offline stream instead of the main page.
Example of someone offline

from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

op = Options()
op.add_argument("user-data-dir=C:UsersbestgAppDataLocalGoogleChromebor")
driver = webdriver.Chrome(options=op)
driver.get('https://www.twitch.tv/mizkif')

#trying to click the avatar 
stream = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.LINK_TEXT, "::before")))
stream.click()

Source: Python Questions

LEAVE A COMMENT