Quantcast
Channel: htmlagilitypack Forum Rss Feed
Viewing all articles
Browse latest Browse all 655

New Post: Using HTML Agility Pack with WP7.5

$
0
0

I successfully added HtmlAgilityPack to my project. However, I tried the following code to extract the body text:

 HtmlAgilityPack.HtmlDocument htmlDoc = new HtmlAgilityPack.HtmlDocument();

   
// There are various options, set as needed
    htmlDoc
.OptionFixNestedTags=true;

   
// filePath is a path to a file containing the html
    htmlDoc
.Load(filePath);

   
// Use:  htmlDoc.LoadXML(xmlString);  to load from a string

   
// ParseErrors is an ArrayList containing any errors from the Load statement
   
if (htmlDoc.ParseErrors!=null && htmlDoc.ParseErrors.Count>0)
   
{
       
// Handle any parse errors as required

   
}
   
else
   
{

       
if (htmlDoc.DocumentNode != null)
       
{
           
HtmlNode bodyNode = htmlDoc.DocumentNode.SelectSingleNode("//body");

           
if (bodyNode != null)
           
{
               
// Do something with bodyNode
           
}
       
}
   
}

and I receive the following error when building the project. 

Error 1 The type 'System.Xml.XPath.IXPathNavigable' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Xml.XPath, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. D:\test\test\MainPage.xaml.cs 58

 

Can you please let me know what the issue is? Thanks for the help.


Viewing all articles
Browse latest Browse all 655

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>