I am trying to extract some inner text using HtmlAgilityPack. Here is the HTML of interest:
<select name="Archives" onchange="javascript:setTimeout('__doPostBack(\'Archives\',\'\')', 0)" id="Archives" style="width:200px;">
<option selected="selected" value="Dashboard_Jul-2012">Dashboard_Jul-2012</option>
<option value="Dashboard_Jun-2012">Dashboard_Jun-2012</option>
</select>
I am using:
string output = htmlwriter.InnerWriter.ToString()
var doc = new HtmlDocument();
doc.LoadHtml(output);
string inner = doc.DocumentNode.SelectSingleNode("//option[@selected='selected']").InnerText;
but all I am getting is the empty string.
Any advice is appreciated.
Regards.