Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# webBrowser Control how to get data under mouse pointer

Hi If I open a site in the WebBrowser control is there anyway to code a function to get data under the mouse pointer?

So what I'm wanting to do, but don't have a clue how to! is load a website (most any website) the user places the mouse over some data on the page and presses control click and on doing so the code works out what the HTML tag below the cursor and reads the inner value of it. hope that makes sense!

in fact just like the pointer control in the MS Developer tool for IE does it even manages to place a box around what would be selected...

I'm only looking for the text no images...

thanks for any help...

like image 674
Adrian Avatar asked Mar 03 '26 00:03

Adrian


1 Answers

Call

webBrowser.Document.GetElementFromPoint(webBrowser.PointToClient(MousePosition))
like image 76
SLaks Avatar answered Mar 04 '26 14:03

SLaks



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!