I am trying to get a select HTML field out of my C# application.
The HTML that can come in are as follows…
<HTML>
<BODY BGCOLOR="#123456">
HELLO
</BODY>
</HTML>
This HTML can change anytime, the part of the HTML I want is the value for BGCOLOR e.g. #123456
or it could be “white”, or “red”, etc…
How can I do this?
I don’t think substring would work as i can’t predict how long the field would be.
Thanks
you can use Html Agility Pack for parsing HTML.
So parsing something like
BGCOLORmight look like: