scrape_menu_rule: Scrape rules within the scrape_menu function

Description Usage Arguments Value Examples

View source: R/scrape_menu_rule.R

Description

Helper function

Usage

1
scrape_menu_rule(url, nodes_only, rulebook_date)

Arguments

url

String. URL to scrape.

nodes_only

XML nodes. Output of "scrape_menu"

rulebook_date

String. Date to scrape.

Value

Data frame

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
has_rules_url <- "http://www.prarulebook.co.uk/rulebook/Content/Chapter/218624/22-03-2006"
no_rules_url <- "http://www.prarulebook.co.uk/rulebook/Content/Chapter/219425/22-03-2006"
nodes_only <- httr::GET(no_rules_url) %>% PRArulebook:::extract_results()
nodes_only <-
nodes_only %>%
  xml2::read_html() %>%
  rvest::html_nodes("a")
scrape_menu_rule()

## End(Not run)

mroliversmith/PRAClone documentation built on Jan. 11, 2020, 2:05 a.m.