InvokeMember with XPath
My purpose is to click a button automat开发者_运维技巧ically in a webBrowser. I am collecting clickables in the source code, and according to these clickables' xpath values, I want to invoke member click.
For invokeMember method, I can use clickable id, but instead, I need to use Xpath. Do you have any ideas?
Here is some code: (I am using c# .NET)
HtmlElement element = browser.Document.GetElementById(ClickableId);
element = browser.Document.GetElementById(ClickableId);
element.InvokeMember("click");
I mean; I want to do this operation with clickable xPath?
From what i've been reading, it is not possible to query a WebBrowser control with XPath.
You might find the following questions useful:
Navigation and WebBrowser control
Get all elements matching an XPath expression in a webbrowser document
精彩评论