G
G
GrossmasterR2020-01-19 22:12:54
HTML
GrossmasterR, 2020-01-19 22:12:54

How to write an Xpath query?

Dear habrchane, hello.
Need your advice.
I have the following html markup for the document:

<html>
<head> </head>

<body>
<div id="div1" class="div">Div1</div>
<div id="div2" class="div">Div2</div>
</body>
</html>

You need to write an xpath query that will find all elements that have class = 'div' and the text contains the substring 'Div'. How can I do this, please advise?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Fov, 2020-01-19
@Roman-Fov

//div[@class='div' and contains(., 'Div')]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question