A PCL+Xamarin port of the infamous HtmlAgilityPack
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Properties
.gitignore Initial commit Nov 16, 2013
EncodingFoundException.cs Initial commit Nov 16, 2013
HtmlAttribute.cs Initial commit Nov 16, 2013
HtmlAttributeCollection.cs Initial commit Nov 16, 2013
HtmlCommentNode.cs Initial commit Nov 16, 2013
HtmlDocument.cs
HtmlElementFlag.cs Initial commit Nov 16, 2013
HtmlEntity.cs Update read usage with dictionary since semantic is slightly differen… Nov 16, 2013
HtmlNameTable.cs
HtmlNode.cs
HtmlNodeCollection.cs Initial commit Nov 16, 2013
HtmlNodeType.cs Initial commit Nov 16, 2013
HtmlParseError.cs Initial commit Nov 16, 2013
HtmlParseErrorCode.cs Initial commit Nov 16, 2013
HtmlTextNode.cs Initial commit Nov 16, 2013
LICENSE Initial commit Nov 16, 2013
MixedCodeDocument.cs Initial commit Nov 16, 2013
MixedCodeDocumentCodeFragment.cs Initial commit Nov 16, 2013
MixedCodeDocumentFragment.cs Initial commit Nov 16, 2013
MixedCodeDocumentFragmentList.cs Initial commit Nov 16, 2013
MixedCodeDocumentFragmentType.cs Initial commit Nov 16, 2013
MixedCodeDocumentTextFragment.cs Initial commit Nov 16, 2013
MobileHtmlAgilityPack.csproj Initial commit Nov 16, 2013
MobileHtmlAgilityPack.sln Initial commit Nov 16, 2013
NameValuePairList.cs Initial commit Nov 16, 2013
README.md Update README.md Nov 16, 2013
crc32.cs

README.md

Mobile HtmlAgilityPack

A PCL+Xamarin port of the infamous HtmlAgilityPack. The port mainly consisted of removing legacy code and unavailable things like explicit usage of file IO API.

The library targets Profile 78 which includes:

  • Xamarin.Android
  • Xamarin.iOS
  • .NET Framework 4.5
  • Windows Phone 8
  • .NET for Windows Store apps

Usage

Apart from the changes introduced by a blander PCL profile, the API is the same than the official library.

Example usage with the XML to LINQ-inspired API:

var doc = new HtmlDocument ();
doc.LoadHtml (answer);
var div = doc.GetElementById ("content");
var table = div.Element ("table");
return table.Element ("tbody").Elements ("tr").Select (row => {
    var items = row.Elements ("td").ToArray ();
    return new Person {
        FirstName = items[0].InnerText.Trim (),
        LastName = items[1].InnerText.Trim (),
    };
});