0

How to click using By.Partial_Text_Link in a proper way?

There is probably a syntax error, but pycharm doesn't give me a solution.

The searched element is not found, the program stops. The faulty code looks like this:

WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.PARTIAL_LINK_TEXT, value="LogSyS"))).click()

How does the syntax have to look like?

This code iswebdriverwa working, but i need WebDriverWait function:

driver.find_element(By.PARTIAL_LINK_TEXT, value= "LogSys").click()
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
fedordima
  • 47
  • 5

1 Answers1

0

Had there been a syntax error you would have faced a TypeError which seems isn't the case in hand.

To click using By.PARTIAL_LINK_TEXT you can use the following optimized syntax:

WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.PARTIAL_LINK_TEXT, "LogSyS"))).click()

If the desired element is still not located/found and raises a TimeoutException you may have a to relook at the locator strategy

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352