user2132274
user2132274

Reputation: 1

Getting data from a webpage table

I know how to read content from a web page , but I am stuck to extract valid content from the page. i want to extract only tables that have some data content. and i have no table id. Like i want to get tables from below link...use c sharp

http://www.unece.org/cefact/locode/service/location.html

Upvotes: 0

Views: 364

Answers (1)

Oded
Oded

Reputation: 499002

In general, for parsing out data from HTML, you should use a purpose built HTML parser.

Two good options are:

  • HTML Agility Pack - uses XPath / LINQ to query the parsed HTML
  • CsQuery - uses jQuery like selector syntax to query the parsed HTML

The choice between the two should boil down to which query syntax you (and your team) are more comfortable with.

Upvotes: 1

Related Questions