url_parse_v2: Parses a vector URLs into a dataframe.

View source: R/RcppExports.R

url_parse_v2R Documentation

Parses a vector URLs into a dataframe.

Description

Parses a vector of URLs into their respective components. It returns a data.frame where each row represents a URL, and each column represents a specific component of the URL such as the scheme, user, password, host, port, path, raw path, raw query, and fragment.

Usage

url_parse_v2(url)

Arguments

url

A vector of strings, where each string is a URL to be parsed.

Value

A data frame with the following columns: - href: The original URL. - scheme: The scheme component of the URL (e.g., "http", "https"). - user: The user component of the URL. - password: The password component of the URL. - host: The host component of the URL. - port: The port component of the URL. - path: The decoded path component of the URL. - raw_path: The raw path component of the URL. - raw_query: The raw query component of the URL. - fragment: The fragment component of the URL.

Examples

library(urlparse)
urls <- c("https://user:password@www.example.com:8080/path/to/resource?query=example#fragment",
          "http://www.test.com")
url_parse_v2(urls)


urlparse documentation built on April 15, 2025, 1:16 a.m.