Ufxtract

Powerful, easy to use .Net microformats parser

Errors

Much like a HTML parser, UfXtract fails quietly during the parsing process. The UfWebRequest class does throw exceptions if it has problems finding a Url. You can catch these exceptions and handle them yourself or pass them through to the data convertors using the UfErrors collection object.

Code example

string url = "http://www.xxxxxxxxxx.yyy/";

UfWebRequest webRequest = null;
UfErrors errors = new UfErrors();
try
{
    webRequest = new UfWebRequest();
    webRequest.Load(url, UfFormats.HCard());
}
catch (Exception ex)
{
    if(webRequest.Urls.Count > 0) 
        errors.Add(new UfError(ex.Message, url, webRequest.Urls[0].Status));
    else
        errors.Add(new UfError(ex.Message, url));
}


UfDataToJson dataConvertor = new UfDataToJson();
Response.ContentType = "application/json";

//Add reporting and errors
dataConvertor.Urls = webRequest.Urls;
dataConvertor.Errors = errors;

Response.Write(dataConvertor.Convert(webRequest.Data, UfFormats.HCard()));
Download Code MIT Open Source License About the UfXtract .Net library

Output formats

Formats

Inputs

.Net

Reporting and Errors