Get a particular input element from a particular form
Like the statement,
string value = document.forms["sap.client.SsrClient.form"].elements["sapwdssr..requestCounter"].value;
in javascript, is there a corresponding statement to get the value of a particular input element within a parti开发者_开发问答cular form in C#?
I can do so by using HTMLDocument and mshtml interface. But that is a rather cumbersome process so if any direct method or property exists it would be great.
I assume you are asking to parse HTML, rather than attempting to do some form of runtime manipulation of a rendered web page, correct?
If that's the case, I highly suggest you look into the HTML Agility Pack, which we have used very successfully to parse HTML as if it were XML. You could do your stuff with a simple XPath query.
精彩评论