Created
January 15, 2020 12:20
-
-
Save mcguinlu/98a5ebac786f5ab2123587f2673eb010 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
# install.packages("rvest") | |
library(rvest) | |
# DEFINE WEBPAGE BASE ADDRESS # | |
url <- "https://www.medrxiv.org/" | |
# OPEN BASE ADDRESS # | |
browseURL(url) | |
# OPEN WEBPAGE VIRTUALLY # | |
page <- read_html(url) | |
# GET INFORMATION FROM PAGE # | |
text <- page %>% | |
html_node(".view-by-month-link") %>% | |
html_text('') | |
path <- page %>% | |
html_nodes(".view-by-month-link") %>% | |
html_attr('href') | |
# CREATE NEW LINK BY ADDING THE PATH TO THE BASE ADDRESS # | |
new.url <- paste0("https://www.medrxiv.org/",path) | |
# OPEN NEW LINK # | |
browseURL(new.url) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment