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

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



a webclient object


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


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.


The page contents can be returned as one of:

  • Parsed HTML (i.e. an xml2 html_document)

  • A string representation of the HTML document. NOTE: The charset used is the current page encoding.

  • A textual representation of this page that represents what would be visible to the user if this page was shown in a web browser. This is useful for, say, text mining.


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


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")