The wikisourcer R package helps you download public domain works from the free library Wikisource.

It includes two functions for downloading books and pages by url.

Installation

install.packages("wikisourcer") # or devtools::install_github("lgnbhl/wikisourcer")

Minimal examples

Download Voltaire’s philosophical novel Candide.

library(wikisourcer)

wikisource_book(url = "https://en.wikisource.org/wiki/Candide")

Download Chapter 1 of Candide.

wikisource_page("https://en.wikisource.org/wiki/Candide/Chapter_1", 
                page = "Chapter 1")

Download Candide in French, Spanish and Italian.

For more information on how to use wikisourcer, please read the vignette.