With intent of use still unclear, I have this to share:
If you are visiting sites that always have the buttons you want to click in the same location, a simple keyboard/mouse macro can run. I have used such macros to gather information in an automated manner, but they could also be used to add clicks to generate bogus traffic if one was trying to generate what looks like traffic from others to get paid per click. BUT those who pay per click traffic usually track to verify that macro bots aren't creating false traffic from a single IP origin to verify the validity of the traffic that they are paying for. I can only think of a company being a fool to pay per click without such an audit to verify validity of the traffic to be real traffic vs simulated traffic from automation.
If you are trying to find button locations that are ever changing, BC had the best option with the
DOM manipulation to find the image and get its position to then send a simulated mouse click to it.
I want to find a text and click on it automatically
As far as hyperlinks in a web page, to follow those which are linked
TEXT, you can create a program that loads the website and searches the HTML for keywords and then reads in the Hyperlink location for that matching text and then runs with that URL to perform additional duties. X and Y location of that text in the page is unnecessary because Hyperlinks in HTML are a standard structure and you can read in all information starting at " and ending at " of the URL to know the start and end point of the URL string in the page you are grabbing the link from. You then can pass that URL into a function that runs to the next page and performs another duty. And that is why finding text is so much easier than finding an image. The only other way i can think of finding an images link would be if the image was always the same name, but that doesnt happen 99% of the time.