CinnamonBun
CinnamonBun

Reputation: 1150

text returning as NULL using htmlagility pack + xpath

I'm currently playing around with htmlagility pack, however, I don't seem to be getting any data back from the following url:

http://cloud.tfl.gov.uk/TrackerNet/LineStatus

This is the code i'm using:

var url = @"http://cloud.tfl.gov.uk/TrackerNet/LineStatus";
var webGet = new HtmlWeb();
var doc = webGet.Load(url);

However, when I check the contents of 'doc', the text value is set to null. I've tried other url's and i'm receiving the HTML used on the site. Is it just this particular url, or am I doing something wrong. Any help would be appreciated.

Upvotes: 0

Views: 57

Answers (1)

Daniel B
Daniel B

Reputation: 8879

HtmlAgilityPack is an HTML parser, thus you won't be successful in trying to parse a non-HTML webpage such as the XML your want to parse.

Upvotes: 1

Related Questions