GetText
The GetText function retrieves the inner text of a specified HTML element on a given page. It is commonly used to extract text content such as headers, paragraphs, button labels, and other textual information from web pages.
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, #username could refer to a textbox element's ID. - Parent - IElementHandle
RpScript
How to use
Pupet.OpenBrowser({ headless: false, browser: "Chrome" });
var pageresponse = Pupet.Visit("https://erametricras.com/");
var buttonText = Pupet.GetText(pageresponse.page, "li#menu-item-1502 > a:nth-child(1) > div.tdb-menu-item-text", null);
Pupet.CloseBrowser();
Extension
