How can I get the XPath from a clicked HtmlElement in the WebBrowserControl?
This is how I retrieve the clicked HtmlElement:
System.Windows.Forms.HtmlDocument document = this.webBrowser1.Document;
document.MouseUp += new HtmlElementEventHandler(this.htmlDocument_Click);
private void htmlDocument_Click(object sender, HtmlElementEventArgs e)
{
HtmlElement element = this.webBrowser1.Document.GetElementFromPoint(e.ClientMousePosition);
}
I want to click specific elements (price, article number, description, etc) on a website and get their XPath expressions.
Thank you!