0

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)         
ElBob
  • 51
  • 5
  • Is this part intended `label[@class `? Shouldn't that class have a value? – Barry the Platipus Jun 06 '23 at 14:11
  • @BarrythePlatipus If I put any other variable or text where {market3} is, it works. I can put {odds} instead of {market3} and webdriver works, but when I put {market3}, driver just doesn't run at all, but it runs when I put anything else. I can put {odds} in both places and it runs, but with {market3}, it doesn't – ElBob Jun 06 '23 at 14:23
  • what does this `print(market3)` print? – KunduK Jun 06 '23 at 14:36
  • @KunduK club names : FC Barcelona, Real Madrid, Valencia, Sevilla, Dos Santos, names like that – ElBob Jun 06 '23 at 16:36

0 Answers0