Skip to main content

FindByFunction

The FindByFunction method checks the conditions of a specific JavaScript function and allows the script to continue when the function meets the desired condition. This means the script will wait until the condition is met and will only proceed when the condition is satisfied.

Parameters

  • page (visitResponse .page): The page object returned by Pupet.Visit.
  • functionQuery - string = It's a string that is used to identify a specific element or elements on a web page.

RpScript​

How to use
Pupet.OpenBrowser({ headless: false, browser: "Chrome" });
var pageresponse = Pupet.Visit("https://erametricras.com/");
Wait(5);
var requestDemo = Pupet.FindByFunction(pageresponse.page, "function() { return document.querySelector('a.tds-button1.tdm-btn.tdm-btn-sm.tdi_347'); }");
Pupet.CloseBrowser();

Extension​