Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

Programatically click on a link ?

Post Reply
User avatar
salvadordf
Posts: 4565
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Programatically click on a link ?

Post by salvadordf »

Hi,

You can use JavaScript to find that link and click it, or you can do what's described here :
https://www.briskbard.com/forum/viewtopic.php?f=8&t=112
X11
Posts: 49
Joined: Thu Jul 25, 2019 10:15 am

Re: Programatically click on a link ?

Post by X11 »

другой example:

introduce JS in html page after load

Code: Select all

var links = document.querySelectorAll('a.link-ajax.j-v-contacts-expand-link');
if (links) {
    for (var x = 0; x <= links.length; x++) {
        if (links[x]) {
            if (links[x].innerHTML.trim().indexOf('text on caption') != -1) {
                links[x].click();               
            }
        }
    }
}
delphi code:

Code: Select all

s := js_code;

Chromium1.Browser.MainFrame.ExecuteJavaScript(s, Chromium1.Browser.MainFrame.Url, 0);
Post Reply