2

Can I parse the html tables by giving only column name ?

Like only those data should be extracted from the table which matches those column names I give.

Like for example I have table of column names like serial no., name, address, phone no,total Rs..

And I want to extract the information about only name, phone no and total Rs.. Then how can I do it?

5
  • do you have html table in winform? Commented Mar 9, 2010 at 10:32
  • Could you give an example of what you have tried? Commented Mar 9, 2010 at 10:32
  • Do you just have access to the HTML, not the underlying data? At least you haven't asked how to do it with regular expressions... Commented Mar 9, 2010 at 10:33
  • @Graham Clark Yes how can I do it with regular expression ? Commented Mar 9, 2010 at 10:43
  • For further information to extract the data from the html data using html Agility pack : stackoverflow.com/questions/2431652/html-agility-pack Commented Mar 13, 2010 at 10:46

3 Answers 3

3

Take a look at Html Agility Pack It provides an LINQ api for searching html content.

Sign up to request clarification or add additional context in comments.

Comments

2

Yes you can. You can use XPATH to scan your html document (google for screen scraping). Another technique is UI testing frameworks like Watin which let you use CSS selectors and more to find elements on a HTML page and get the contents.

4 Comments

@DarkwingDuck XPATH ? Is it the class or anything else which is inbuilt in .net ?
@DarkWingDuck Through that only those data will be extracted for which I will give input of column names ?.
Yes XPath is an XML function which uses a particular syntax for finding elements in XML documents. XPath is supported fully in .Net. And sorry, I didn't understand your second question.
I wanted to say that through the XPATH it is possible that only that data will be retrieved which is of the column name I want As I explained in my main question above with example.
1

You can use Data Extracting SDK which has HtmlProcessor class with Tables property which handles HTML tables as DataTable objects.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.