Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

This library uses AngelSharp to parse an HTML string into a document object model. The library targets .NET Framework 4.7.2 so that it is compatible with Windows PowerShell.

Notifications You must be signed in to change notification settings

nstevens1040/AngleSharp.DOMParser

Open more actions menu

Repository files navigation

Build status

AngleSharp.DOMParser

This library uses AngelSharp to parse an HTML string into a document object model. The library targets .NET Framework 4.7.2 so that it is compatible with Windows PowerShell.

Build the Library

Compiling in Windows PowerShell

git clone https://github.com/nstevens1040/AngleSharp.DOMParser.git
cd .\AngleSharp.DOMParser\
MSBuild.exe -p:RestorePackagesConfig=true -t:restore
MSBuild.exe .\AngleSharp.DOMParser\AngleSharp.DOMParser.csproj

Load the Library

Into Windows PowerShell and then test it.

Add-Type -Path .\AngleSharp.DOMParser\bin\build\AngleSharp.DomParser.dll
$html_string = @"
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8"/>
        <meta name="viewport" content="width=device-width,initial-scale=1"/>
        <title>Testing HTML</title>
    </head>
    <body>
        <h1>Heading</h1>
        <article>
            <section>
                <h2>subtitle</h2>
                <p>paragraph</p>
                <span id="test">Test succeeded!</span>
            </section>
        </article>
    </body>
</html>
"@
$document = [AngleSharp.DomParser]::GetDomDocument($html_string)
$document.GetElementById("test").TextContent

If the test succeeds, then your PowerShell output will be

Test succeeded!

About

This library uses AngelSharp to parse an HTML string into a document object model. The library targets .NET Framework 4.7.2 so that it is compatible with Windows PowerShell.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published
Morty Proxy This is a proxified and sanitized view of the page, visit original site.