knitr::opts_chunk$set(echo = TRUE)

Getting the page text

downloading content

wp_content <- WikipediR::page_content("en","wikipedia", page_name ="holodiscus discolor")
str(wp_content)

Saving to a file

Simply saving the content does not render images or links correctly:

writeChar(wp_content$parse$text[["*"]], con= "test.html")

CSS files can be found here: https://en.wikipedia.org/wiki/Wikipedia:Catalogue_of_CSS_classes

using wkhtmltopdf

To convert html to pdf: http://wkhtmltopdf.org

This can take multiple html files and convert it to a single pdf



zachary-foster/fieldguide documentation built on May 29, 2019, 12:19 p.m.