<root>
<a href="#"><img src="image1.jpg" /></a>
<a href="#"> <img src="image2.jpg" /> </a>
<a href="#">
<img src="image3.jpg" />
</a>
<a href="#">
<img src="image4.jpg" />
<img src="image5.jpg" />
</a>
<a href="#">
<img src="image6.jpg" />
Изображение с изображением изображения
</a>
<a href="#"><img src="image7.jpg" />Изображение с изображением изображения</a>
</root>
/root/a[normalize-space(translate(., ' ', '')) = '' and count(*) = 1]/img
Element='<img src="image1.jpg"/>'
Element='<img src="image2.jpg"/>'
Element='<img src="image3.jpg"/>'
//div[not(contains(@style, 'none'))]
//select[@name = 'LAMP[]']/option[@value = 'yellow']
<root>
<foo>
<bar>
<baz>asdf</baz>
<text>text1</text>
</bar>
</foo>
<foo>
<bar>
<text>text2</text>
</bar>
</foo>
<foo>
<bar>
<baz>3</baz>
<text>text3</text>
</bar>
</foo>
</root>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/root">
<xsl:apply-templates select="foo"/>
</xsl:template>
<xsl:template match="foo">
<h1 style="color:red;">
<xsl:attribute name="style">
<xsl:choose>
<xsl:when test="count(bar/baz) > 0">
<xsl:text>color: red;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>color: green;</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:apply-templates select="bar/text"/>
</h1>
</xsl:template>
</xsl:stylesheet>
<h1 style="color: red;">text1</h1>
<h1 style="color: green;">text2</h1>
<h1 style="color: red;">text3</h1>
//div[@id = 'preloader' and not(@style)]
//div[@id = 'preloader' and @style = 'display: none;']
<div>
<div class="asdf wrapper">
<table>
<tr class="table__row">
<td>
<span class="campaign-info-number">302177</span>
</td>
</tr>
<tr class="table__row">
<td>
<span class="campaign-info-number">302178</span>
</td>
</tr>
<tr class="table__row">
<td>
asdf
</td>
</tr>
</table>
</div>
</div>
//div[contains(@class, 'wrapper')]//tr[contains(@class, 'table__row') and .//span[contains(@class, 'campaign-info-number')]/text() = '302177']
<tr class="table__row">
<td>
<span class="campaign-info-number">302177</span>
</td>
</tr>
//div[@class = 'item-card-detailed__table_column item-card-detailed__table_column-second']/div[position() = count(//div[@class = 'item-card-detailed__table_column']/div[text() = 'Цвет']/preceding-sibling::div)+1]
<div>
<p>par</p>
<strong>strong</strong>
<divd>
<p>divpar</p>
</divd>
<blockquote>
<p>bqpar <strong>bqparstrong</strong></p>
</blockquote>
</div>
//p[name(ancestor::blockquote[1]) != 'blockquote']|//strong[name(ancestor::blockquote[1]) != 'blockquote']|//blockquote
Element='<p>par</p>'
Element='<strong>strong</strong>'
Element='<p>divpar</p>'
Element='<blockquote><p>bqpar <strong>bqparstrong</strong></p></blockquote>'
p/code[normalize-space(preceding-sibling::text()[1]) = 'рездел1:']/text()
p/strong[normalize-space(preceding-sibling::text()[1]) = 'рездел2:']/text()
<tr>
<td class="rborder" align="center">1234</td>
<td class="rborder" align="center">
Клубника
</td>
</tr>
/tr/td[contains(., '1234')]/following-sibling::td/normalize-space(text())
String='Клубника'
<root>
<elem attr="a">a</elem>
<elem attr="b">b</elem>
<elem attr="c">c</elem>
</root>
/root
<root>
<elem attr="a">a</elem>
<elem attr="b">b</elem>
<elem attr="c">c</elem>
</root>
/root/*[@attr != 'b']
<elem attr="a">a</elem>
<elem attr="c">c</elem>
//div[starts-with(@class, 'track track_selectable') and ((number(substring-before(div[@class='track__info track__nohover']/span[3]/text(), ':')) * 60) + number(substring-after(div[@class='track__info track__nohover']/span[3]/text(), ':'))) > 200]/*[@class='track__name']//h1/a/text()
/div/aside/following-sibling::text()[normalize-space(.) != '']