# Filter HTML Contents

This script can be used to create a new HtmlDocument variable, loading the html code(from a text file, web), selecting the nodes to be parsed, converting the variable into a list and printing the output.

```csharp
HtmlDocument doc = new HtmlDocument();
doc.LoadHtml(htmlOutput);
HtmlNodeCollection selectedHtmlNodes = doc.DocumentNode.SelectNodes("//html/body");
selectedHtmlNodes.ToList();
```

{% hint style="info" %}
“InnerText”  - text only

“InnerHtml” - whole html code
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tailent.com/scripting-utility-classes/common-scripts-repository/c-scripts-repository/filter-html-contents.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
