I need to extract the value of an element from an HTML page many times. Something like that:
<!-- many html here --> <input type="hidden" name="id" value="ExtractMe!"> <!-- many html here -->
How easy is it to extract value?
Check out the HTMLAgility package , it makes this type of task very simple and without regex.
If you need to parse HTML in your C # application, consider using HTMLAgilityPack here http://htmlagilitypack.codeplex.com/
, , , XML. XML LINQ.
here .
Why aren't you using regular expressions? This is the MSEx Regular Expression Documentation , where you can see the section Extracting a Single Match or the First Match.
Extracting a Single Match or the First Match