A Way to Make Chrome Click on or Select Objects Inside a Webpage

Hello, and Happy New Year. I'd like to say how great it is to have this great group of people to talk with and get help from as we all try to get through this crisis. Special thanks to Peter for getting KM to work on M1 Macs so fast!

My question is, how can I use KM to click on elements inside a website. In this case, I want to use KM to click on the Upload an Image then Choose File without me having to resort to less-than-perfect click on found image. KM seems to pre-populate the commands with some javascript objects (or whatever they are), so I thought I could choose one of those, but nothing seems to work. The goal is to automate clicking on choosing an image in google images, assuming there's no matter way to do it (such as directly telling Chrome what local file to select without opening the dialogue box).

Any help would be appreciated!

Sorry, but are you uploading or downloading an image?
Please give a couple of URLs as an example of what you are trying to do.
I am not sure if this is relevant, but which browser(s) are you using?

Sorry, I am uploading an image from a specific already set-up folder. I do a lot of google image search uploads, and am trying to learn how to click on or access Javascript (?) elements inside websites using KM rather than clicking on found images, which is never 100% precise, especially as I use my laptop in laptop mode, on a normal monitor, and on a really large monitor at different times.

So the goal is to open https://images.google.com/?gws_rd=ssl, click on the camera picture, click on Upload image, then click on choose file, with KM telling those elements to be clicked on or otherwise activate, directly.

Hey Peter (@ppayne),

This works – although not entirely to my satisfaction.

My JavaScript isn't good enough yet to make it so. The JavaScript itself should wait for the appearance of the given elements, and I'm relying on pauses.

Google obfuscates the code, so people can't do what you're trying to do very easily – and the given code could change at any time.

I'm not seeing a way to make ID'ing the elements really reliable, but again my understanding of JavaScript isn't deep enough to suss that out with authority.

I've spent about as much time as I'm willing – to hopefully give you and idea of what's possible.

-Chris


Google ⇢ Activate FInd by Image v1.00.kmmacros (7.0 KB)

Hey Chris, see MACRO: Pause Until Web Page Element Exists [Example]

Ah, so.

Thanks.

1 Like