简体   繁体   中英

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM