execute_script: Page class: Execute JavaScript code on the page

View source: R/page_utils.R

execute_scriptR Documentation

Page class: Execute JavaScript code on the page

Description

The execute_script function executes the specified JavaScript code on the page object within a web browser session.

Usage

execute_script(page_df, script)

Arguments

page_df

A data frame containing page information, including the page_id column. This data frame is used to identify the page object on which the JavaScript code should be executed.

script

A character string representing the JavaScript code to execute on the page.

Value

The result of executing the JavaScript code on the page.

Examples

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

# Execute JavaScript code on the page using the page_df
execute_script(page_df, "alert('Hello, World!');")



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