get_src_by_attr: Gets a web element based on a specific attribute that matches...

View source: R/get_src_by_attr.R

get_src_by_attrR Documentation

Gets a web element based on a specific attribute that matches regex

Description

Gets a web element based on a specific attribute that matches regex

Usage

get_src_by_attr(
  base,
  css,
  xpath,
  attr,
  attr_regex,
  date_regex = NULL,
  date_format = "mdy"
)

Arguments

base

character string of the URL

css

css option to search html nodes

xpath

xpath option to search html nodes

attr

character the attribute to pull a string from

attr_regex

character regex to search in attributes

date_regex

character string to extract date from attribute

date_format

character the format to convert the date from

Value

character of the url specified by the search

Examples

## Not run: 
get_src_by_attr(
    base = "https://doc.arkansas.gov/covid-19-updates/",
    css = "a",
    attr = "href",
    attr_regex = "(?i)stats.?update",
    date_regex = "\\d+-\\d+-\\d+")

## End(Not run)


uclalawcovid19behindbars/behindbarstools documentation built on April 22, 2022, 4:08 a.m.