Created
June 3, 2019 02:44
-
-
Save josephsdavid/22d7a188faacef6c61068bb315b70286 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(rvest) | |
library(tidyverse) | |
# html scraper is a function of the url and the element of the list | |
html_scraper <- function(url, elem){ | |
read_html(url) %>% html_nodes("table") %>% . [[elem]] %>% html_table -> out | |
return(out) | |
} | |
# usage | |
# html_scraper( 'http://pokemondb.net/pokedex/all' , 1 ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment