Scrape Instagram using the instagram-java-scraper Java library in R.
Based on the project of postaddictme.
To run Java applications you need the Java Runtime Environment.
To execute Java code in R you need to install the package rJava from CRAN:
install.packages("rJava")
- Configure the settings at the top of the script
scraper.R
:
## User account to scrape
user_account <- "berlinphil"
## Max number of posts to retrieve
media_count <- as.integer(100)
- Run the script:
source("scraper.R")
- Find the output datasets in the
./dataout/
directory.