body_anchor_urls: Extract all body anchor hypertext references

Description Usage Arguments Value Examples

View source: R/body-links.R

Description

Given a valid HTML/XML document, node set or single node, a claracter vector of all <body> <a href> URLs will be returned. If base is not NULL all relative URLs will be converted to absolute URLs.

Usage

1

Arguments

x

Either a document, a node set or a single node.

unique

if TRUE, then only unique URLs will be returned. Default: FALSE.

base

if not NULL, all relative URLs will be converted to absolute URLs. Default: NULL.

Value

character vector of extracted URLs; if no <a> href URLs were discovered charactrer(0) will be returned.

Examples

1
2
x <- rvest::read_html("https://congress.gov/")
body_anchor_urls(x, unique = TRUE, base = "https://congress.gov/")

hrbrmstr/urldiversity documentation built on May 14, 2019, 4 a.m.