开发者

How to invoke a click method on an html page which has no id/name but a class name in c#?

I am writing an automation for web site. I am using the HTMLelement in th开发者_如何学编程e MSHtml package.Using this object I can only get elemnts by tag names/id's but not by Class name.

The above tag is a button. I waould like to invoke a click method on it.

Please help......


I am assuming that you are using IHTMLElement interface, with which you can iterate over the document and check the className member, collecting those that match.

If you are using 3.5, this sounds like a good place for Linq + an extension method.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜