Use phantomjs to get a page from ECOS

get_ECOS_page(url = NULL, file = NULL, wait = TRUE)

Arguments

url
The URL of the species' ECOS page
file
The path to which the HTML will be written

Value

The status of the phantomjs scrape (1 or 0) or NULL if an HTTP error

Details

A significant amount of content on ECOS pages is rendered from javascript functions, and 'standard' scraping tools like read_html miss those components. https://github.com/ariya/phantomjs provides a function (phantomjs) to render the full page, complete with javascript elements, and write them to file.

This function should be preferred over get_species_page in most cases even though it is slightly slower with the scrape because it will get certain tables (e.g., the petitions table) and content like the species' range map data.

Examples

## Not run: ------------------------------------ # An example, not run ## ---------------------------------------------