Veronica
Coder
I have a few elements I want to click with selenium. The elements are hidden and I'm using the format right. Consequently, I'm looking for a workaround to iterate the function. I have the function in curly braces with the 'f' format to read the function. In order to see the element I have to switch the format to 'u'. The 'u' format only allows you to find hidden elements. Unfortunately, it does not read functions within curly braces. Which makes things more difficult to change the value within the variable. Also, there is no way to use both 'u' and 'f'. My question is if there is a workaround to achieve this task.
error - cannot locate element
error - can only hold one argument
Code:
browser.find_element(By.XPATH, f"/html/body/app-root/ac-site-layout/div[{number}]")
error - cannot locate element
Code:
browser.find_element(By.XPATH, u"/html/body/app-root/ac-site-layout/div[{number}]")
error - can only hold one argument