I'm trying to make selenium close a tab after it spots a text saying 'Universal Script'
Right now I have this but it doesn't seem to work
is_universal = None
if title == "Universal Script":
is_universal = True
if is_universal == None:
''rest of the code''
driver.close()
Code for the text
title = driver.find_element(By.XPATH, '/html/body/div[1]/div/div/div[1]/main/div[2]/div[2]/div[1]/span').text