urltools (version 1.2.0)

url_parameters: get the values of a URL's parameters

Description

URLs can have parameters, taking the form of name=value, chained together with & symbols. url_parameters, when provided with a vector of URLs and a vector of parameter names, will generate a data.frame consisting of the values of each parameter for each URL.

Usage

url_parameters(urls, parameter_names)

Arguments

urls
a vector of URLs
parameter_names
a vector of parameter names

Value

  • a data.frame containing one column for each provided parameter name. Values that cannot be found within a particular URL are represented by an empty string.

See Also

url_parse for decomposing URLs into their constituent parts.

Examples

Run this code
#A very simple example
url <- "https://google.com:80/foo.php?this_parameter=selfreferencing&hiphop=awesome"
parameter_values <- url_parameters(url, c("this_parameter","hiphop"))

Run the code above in your browser using DataCamp Workspace