Learn R Programming

parsel (version 0.3.0)

click: wrapper around clickElement() method to generate safe scraping code

Description

wrapper around clickElement() method to generate safe scraping code

Usage

click(using, value, name = NULL, new_page = FALSE, prev = NULL)

Value

a character string defining 'RSelenium' clicking instructions that can be pasted into a scraping function.

Arguments

using

character string specifying locator scheme to use to search elements. Available schemes: "class name", "css selector", "id", "name", "link text", "partial link text", "tag name", "xpath".

value

character string specifying the search target.

name

character string specifying the object name the RSelenium "wElement" class object should be saved to.

new_page

logical indicating if clickElement() action will result in a change in url.

prev

a placeholder for the output of functions being piped into click(). Defaults to NULL and should not be altered.

Examples

Run this code
if (FALSE) {

#navigate to wikipedia, click random article

parsel::go("https://www.wikipedia.org/") %>>%
parsel::click(using = "id", value = "'n-randompage'") %>>%
show()

}

Run the code above in your browser using DataLab