fileURLextractor: fileURLextractor function

Description Usage Arguments Value Examples

View source: R/fileURLextractor.R

Description

This function extracts the links and urls from an html page of the Central Election Commission.

Usage

1
fileURLextractor(html_file, tabextract = NULL, hashid = FALSE, messages = TRUE)

Arguments

html_file

html file object.

tabextract

a table number to extract in order to override the table selection algorithm (by default, 1).

hashid

generate a unique md5 hash id for election (TRUE).

messages

display progress messages (TRUE).

Value

Returns the data.frame object containing levels, links and urls of elections.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(CECscraper)
library(rvest)

webpage <- read_html(system.file("elections_primorye.html", package="CECscraper"))

wterrit <- webpage %>% fileURLextractor(hashid = TRUE)
wterrit$webscrape[1] <- FALSE
res_territ <- wterrit %>% rowURLextractor("Rezul`taty vyborov") %>%
listURLextractor() %>%
dataBuilder(ttime = FALSE, typedata = "slow", bylevel = "level3")

kkalininMI/CECscraper documentation built on Oct. 28, 2020, 1:47 a.m.