When I use webdrive to click on element and if I put specific variable in it, it just skips over the webdriver and continues to run the rest of code. Variable in question is market3 and if instead of {market3} I put any other text it works normally.
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, f"//h3[@class='runner-name' and text()='{market3}']//ancestor::tr//label[@class and text()='{odds}']"))).click()
This is how I get value for {market3}
matchname = (WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//a[contains(@href, '/nav/valuebet/event/')]")))).text
matchname1 = matchname
elif "1" in market2:
market3 = matchname1.split(sep, 1)[0]
market3 = market3.strip()
print(market3)