Author Topic: VB find html location move mouse and click  (Read 3839 times)

Opopanax

  • Newbie
  • *
  • Posts: 1
VB find html location move mouse and click
« on: September 09, 2020, 01:43:42 PM »
It's been years since I had a reason to write some VB and I think I'm at that point. All my VB experience didn't include anything with browsers so what I want to do is a bit out of my experience scope.

This is what I'm looking to do. I'm using a browser (chrome) as an active window. There's various HTML elements where I may know the ID or the Class and I want to replicate having the mouse move to that location and do a left-click. I'm okay with the mouse actually moving or spoofing a mouse click. The goal is to help me automate a series of clicks where the actual X/Y coordinates can change based on the application window size and resolution.

I'm guessing based on what I've seen if my element ID on the active window page is 66:227;a I'll do something like:

WebBrowser1.Document.GetElementById("66:227;a").InvokeMember("click")

What I'm trying to figure out is how do I include the WebBrowser class (assuming it's possible) or if I"m simply going down the wrong way and there's a better way to do this. Any thoughts, suggestions, and direction is appreciated.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: VB find html location move mouse and click
« Reply #1 on: September 09, 2020, 02:03:01 PM »
You mention Chrome, but the WebBrowser class uses its own internal browser, it doesn't interface with an external browser.


This would probably be a question best asked somewhere that deals with VB.NET programming specifically.