M
M
martensit2018-11-29 21:59:34
XPath
martensit, 2018-11-29 21:59:34

How to find an element in XPath by several conditions?

There is a DIV whose @class='reply' and @id='123'
How can I specify them both via logical "AND" ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2018-11-29
@martensit

//div[@id='x' and @class='y']
//div[@id='x'][@class='y']

logically id must be unique. and if this is so, then it is enough to choose only on it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question