scrape: Scrape the content of authorized page/API

scrapeR Documentation

Scrape the content of authorized page/API

Description

Scrape the content of authorized page/API

Usage

scrape(
  bow,
  query = NULL,
  params = NULL,
  accept = "html",
  content = NULL,
  verbose = FALSE
)

Arguments

bow

host introduction object of class polite, session created by bow() or nod()

query

named list of parameters to be appended to URL in the format list(param1=valA, param2=valB)

params

deprecated. Use query argument above.

accept

character value of expected data type to be returned by host (e.g. html, json, xml, csv, txt, etc.)

content

MIME type (aka internet media type) used to override the content type returned by the server. See http://en.wikipedia.org/wiki/Internet_media_type for a list of common types. You can add the charset parameter to override the server's default encoding

verbose

extra feedback from the function. Defaults to FALSE

Value

Object of class httr::response which can be further processed by functions in rvest package

Examples


 library(rvest)
  bow("https://en.wikipedia.org/wiki/List_of_cognitive_biases") %>%
   scrape(content="text/html; charset=UTF-8") %>%
   html_nodes(".wikitable") %>%
   html_table()



polite documentation built on July 9, 2023, 5:21 p.m.