#' @title Get Content
#' @param url page url
#' @description gets tables from url
#' @keywords html xml
#' @importFrom magrittr %>%
#' @export
#' @examples
#' getContent("https://www.basketball-reference.com//players/a/adamsst01.html")
getContent <- function(url) {
doc <- readDocument(url)
cont <- httr::content(doc, "text") %>%
gsub(pattern = "<!--\n", "", ., fixed = TRUE) %>%
xml2::read_html() %>%
rvest::html_nodes(".table_outer_container table") %>%
rvest::html_table(fill = TRUE)
return (cont)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.