FindElementsWithWait
The FindElementsWithWait function is designed to locate and return a collection of elements within the DOM (Document Object Model) of a web page. It uses a CSS selector to identify these elements and includes a waiting mechanism to ensure the elements are available before attempting to retrieve them.
Parameters
- page (visitResponse .page): The page object returned by Pupet.Visit.
- selector -
String: The CSS selector used to identify the element within the iframe. For example, #button-id could refer to a button element's ID. - waitForSelectorOptions -
WaitOption= Options for wait operations
RpScript
How to use
Pupet.OpenBrowser({ headless: false, browser: "Chrome" });
var pageresponse = Pupet.Visit("https://erametricras.com/");
var WaitOptionForTry = Pupet.WaitOptionForTry(2000);
var element = Pupet.FindElementWithWait(pageresponse.page, "li#menu-item-1502 > a:nth-child(1) > div.tdb-menu-item-text", null, WaitOptionForTry);
Pupet.CloseBrowser();
Extension
