2

I'm having a problem with xpath finding element I need.

Here's html code im trying to find.

name="itemData[analysis][0][Pd]"

And that's how I'm trying to find it

def find(driver,path):
element = WebDriverWait(driver, 10).until(
    EC.presence_of_element_located((By.XPATH, path)))
return element
element = find(driver, "//input[@name='itemData[analysis].[0].[Pd]'").send_keys(1)

I know the problem is in how I format, the path, but I have no idea how to format it correctly.

1 Answer 1

1

Make use of XPATH contains here :

//name[contains(@name, 'itemData[analysis][0][Pd]')]

or

//name[contains(@name, 'itemData')]

or

//name[contains(@name, 'itemData[analysis]')]

and so on..

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.