From 3165342d07b53450698e535b5e1bd2dce42a5915 Mon Sep 17 00:00:00 2001 From: gittaca Date: Sun, 19 Jul 2020 20:23:26 +0000 Subject: [PATCH] Try httr's hostname extraction --- R/parse_url.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/parse_url.R b/R/parse_url.R index 0dc6a0c..d90743b 100644 --- a/R/parse_url.R +++ b/R/parse_url.R @@ -28,7 +28,7 @@ #' parse_url <- function(url){ match <- - stringr::str_match(url, "(^\\w+://)?([\\w.]+)?(/.*)?")[, -1, drop = FALSE] + httr::parse_url(url)$hostname df <- as.data.frame(match, stringsAsFactors = FALSE) names(df) <- c("protocol", "domain", "path")