Description Usage Arguments Value Examples
View source: R/fileURLextractor.R
This function extracts the links and urls from an html page of the Central Election Commission.
1 | fileURLextractor(html_file, tabextract = NULL, hashid = FALSE, messages = TRUE)
|
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). |
Returns the data.frame object containing levels, links and urls of elections.
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.