开发者

Get a particular input element from a particular form

开发者 https://www.devze.com 2023-03-21 15:09 出处:网络
Like the statement, string value = document.forms[\"sap.client.SsrClient.form\"].elements[\"sapwdssr..requestCounter\"].value;

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消