select_option | R Documentation |
The select_option
function selects an option from a dropdown element. It can either locate the dropdown using a provided selector or by referencing an element previously located.
select_option(page_df, option, selector = NULL)
page_df |
A data frame containing page information, including the |
option |
A character string representing the option to select from the dropdown. |
selector |
(Optional) A character string representing the selector of the dropdown.
If provided, the dropdown will be located using the selector. If not provided, the |
The updated page_df
data frame.
# Create a page_df data frame
page_df <- data.frame(page_id = "my_page")
# Select an option from a dropdown using a selector
select_option(page_df, "Option 1", selector = "#myDropdown")
# Select an option from a dropdown using a previously located element
page_df <- get_by_role(page_df, "combobox")
select_option(page_df, "Option 2")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.