Get base domain
Function: Get base domain
This function helps you extract just the main part of a web address, known as the base domain, from a full URL. For example, if you have https://www.example.com/products/item123, this function will give you example.com. It's useful when you need to identify the primary website without all the extra path or query details.
Input,
- Url (Type: URL) The complete web address from which you want to get the base domain. This input is required.
Output,
- Result (Type: URL)
The extracted base domain name (e.g.,
example.com). This output will be stored in a variable namedRESULTby default, but you can change this name if needed.
Execution Flow,
Real-Life Examples,
-
Extracting a simple domain from a full URL
- Inputs:
Url:https://www.mycompany.com/about-us/team
- Result:
The function successfully extracts
mycompany.comand stores it in theResultvariable.
- Inputs:
-
Handling a URL without a protocol
- Inputs:
Url:blog.example.org/latest-news
- Result:
The function automatically adds
https://to the URL, then extractsblog.example.organd stores it in theResultvariable.
- Inputs:
-
Extracting domain from a URL with port and query parameters
- Inputs:
Url:http://dev.api.service.net:8080/data?user=admin
- Result:
The function extracts
dev.api.service.netas the base domain, ignoring the protocol, port, and query parameters, and stores it in theResultvariable.
- Inputs: