Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

How to scrape a string from webpage in R using rvest

$
0
0

I have a vector with 602 URLs that starts like this:

links <- c("URL1.com", "URL2.com", "URL3.com)

Each URL links to a webpage.

Somewhere on each of the webpages is a year in the format YYYY as in 2019 but it is not always in the same place.

There is only one year on each webpage and I want R to give me an output that provides the year on each webpage.

I have tried using rvest but I presume I need to know the specific location on each webpage.

How can I successfully scrape the year from the webpages?


Viewing all articles
Browse latest Browse all 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>