get_by_text: Page class: Get element by text

View source: R/get_utils.R

get_by_textR Documentation

Page class: Get element by text

Description

The get_by_text function retrieves an element with the specified text from the page object within a web browser session.

Usage

get_by_text(page_df, text)

Arguments

page_df

A data frame containing page information, including the page_id column. This data frame is used to identify the page object from which the element should be retrieved.

text

A character string representing the text of the element to retrieve.

Value

The updated page_df data frame with an additional elem_id column containing the identifier of the retrieved element.

Examples

# Create a page_df data frame
page_df <- data.frame(page_id = "my_page")

# Retrieve an element by text using the page_df
get_by_text(page_df, "Click Me")


benjaminguinaudeau/playwrightr documentation built on Nov. 8, 2023, 8:36 p.m.