There is a problem with selecting the id from the html of the case document in that the id value changes, but the beginning is always the same.

var node = doc.DocumentNode.SelectNodes("//span[@id='Cars_(А здесь разное содержимое) ']"); 

How can I use one linq request to remove all id values ​​from a web page? That is, I need from the line above, only it is Cars_(А здесь разное содержимое) .

  • If I understand correctly, this is not a linq query at all, but rather like XQuery. - neftedollar

2 answers 2

Try using the starts-with () XPath function

 var node = doc.DocumentNode.SelectNodes("//span[starts-with(@id, 'Cars_']"); 

    It’s best to use CSS Selector, I don’t see any other way. I can advise AngleSharp . This is the best thing to do in this matter.