Answer the question
In order to leave comments, you need to log in
How to exclude class from xpath query in C#?
Hello.
There are such xpath queries:
outputHtml = HD.DocumentNode.SelectNodes("//div[@class='reader-text font-size-medium']");
outputHtml = HD.DocumentNode.SelectNodes("//div[@style='display: block; text-align: justify; margin-bottom: 12px;']");
<div class="reader-pagination"><a class="pull-left chapter-btn" id="link-left" href="/reader/ne-princ-no-soidesh-b34996?c=276330">Пред. часть</a><div class="col-xs-offset-4 pag-center"><span class="current">1</span><a onclick="Reader.goTo(2)">2</a><span class="dots">...</span><a class="first" onclick="Reader.goTo(4)">4</a></div><a class="pull-right" id="link-right" onclick="Reader.goTo(2)"><i class="glyphicon glyphicon-chevron-right"></i> Вперед</a><div class="clearfix"></div></div>
Answer the question
In order to leave comments, you need to log in
It is difficult to answer this question without a full document and a more accurate understanding of the problem. You can select everything except a certain element by excluding it in the xpath.
Those change the principle of document processing. Process not the element element1 itself, but all child elements to element1.
Let's say we have a document:
<root>
<elem attr="a">a</elem>
<elem attr="b">b</elem>
<elem attr="c">c</elem>
</root>
<root>
<elem attr="a">a</elem>
<elem attr="b">b</elem>
<elem attr="c">c</elem>
</root>
<elem attr="a">a</elem>
<elem attr="c">c</elem>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question