Click here to Skip to main content
15,887,434 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everyone,
I want to read a set of HTML tag from existing web page online. I can read the entire page and I have the HTML in a string var. there are many table tags with id. I want to extract particular table tag (");
string newstring = data.Substring(index1, 46502);
}<table id="gsc_rsb_st>.....</table>)
entirely.
Please help.
Thanks in advance.

What I have tried:

So far I have done like this:
string urlAddress = "></table>
Posted
Updated 3-May-23 22:40pm
v2
Comments
Richard Deeming 4-May-23 4:40am    
Looks like your code got corrupted when you pasted it into the question.

Get a copy of the NuGet Gallery | HtmlAgilityPack 1.11.46[^], it can extract any information you need from a web page.

[edit]
Better idea, use the link provided in OriginalGriff's solution.
[/edit]
 
Share this answer
 
v2
Comments
OriginalGriff 4-May-23 3:44am    
:thumbsup:
Richard MacCutchan 4-May-23 3:47am    
Thanks, but my link was obviously not the one I should have found.
To add to Richard's excellent recommendation, I'd suggest you start here: Html Agility Pack[^] - the syntax can be a little arcane when you first look at it, but it's very flexible and powerful.

HTMLAgilityPack is what I use when I need to get info from a site.
 
Share this answer
 
Further to Richard's and OriginalGriff's suggestions, this should get you there quickly: https://stackoverflow.com/questions/655603/html-agility-pack-parsing-tables[^]

Here is the Google Search that I used: HTMLAgilityPack extact table[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900