wc_render: Retrieve current page contents

Description Usage Arguments Details Value Note Examples

View source: R/wc-as.R

Description

If there is a page in the active browser context, return the contents of the page.

Usage

1
wc_render(wc_obj, what = c("parsed", "html", "text"))

Arguments

wc_obj

a webclient object

what

what to return (see Details); NOTE that if there is no active page this function returns NULL.

Details

The page contents can be returned as one of:

Value

if what is parsed, an xml2 html_document; if html, the character HTML representation of the page; if text the rendered text of the document as viewed by a human.

Note

This is an information retrieval function that does not return the wc_obj so must be the last function call in a webclient pipe.

Examples

1
2
3
4
5
w <- web_client()
wc_go(w, url = "https://hrbrmstr.github.io/htmlunitjars/index.html")
wc_render(w, "parsed")
wc_render(w, "html")
wc_render(w, "text")

hrbrmstr/htmlunit documentation built on Aug. 19, 2020, 3:05 p.m.