Get HTML of webpage
Function: Get HTML of webpage
This action allows your application to visit any public webpage, retrieve its entire HTML content, and store it for further use within your application. It's perfect for gathering information from external websites without needing to write any code.
Input
- Webpage URL
- Description: The complete web address of the page you want to get the HTML from. Make sure to include the protocol, like
https://www.example.com. - Type: Text (URL)
- Required: Yes
- Description: The complete web address of the page you want to get the HTML from. Make sure to include the protocol, like
- Query parameters
- Description: Additional key-value pairs that you want to add to the end of your Webpage URL. These are often used to filter or specify data when requesting information from a website. For example,
?search=term&page=2. - Type: Key-Value Pairs (Object)
- Description: Additional key-value pairs that you want to add to the end of your Webpage URL. These are often used to filter or specify data when requesting information from a website. For example,
Output
- Response
- Description: The name of the variable where the retrieved HTML content of the webpage will be stored.
- Type: Text
- Default Value:
HTML
- Status
- Description: The name of the variable that will hold the outcome of this action. Possible values include:
SUCCESS: The HTML was retrieved successfully.BAD_REQUEST: The request sent to the webpage was invalid.UNAUTHORIZED: Your application was not authorized to access the webpage.NOT_FOUND: The specified webpage could not be located.READ_TIMEOUT: The connection timed out while waiting for the webpage's response.CONNECT_TIMEOUT: The connection timed out while trying to establish a link to the webpage.
- Type: Status Indicator
- Default Value:
STATUS
- Description: The name of the variable that will hold the outcome of this action. Possible values include:
Execution Flow
Real-Life Examples
Example 1: Retrieving a Company's Homepage Content
Imagine you want to automatically get the latest content from your company's "About Us" page to display a snippet on your internal dashboard.
- Inputs:
- Webpage URL:
https://www.yourcompany.com/about-us - Query parameters: (Leave empty)
- Webpage URL:
- Result: The action successfully fetches the HTML of the "About Us" page. The
HTMLvariable will contain the full HTML code of that page, and theSTATUSvariable will be set to "SUCCESS".
Example 2: Fetching Search Results with Specific Filters
You need to scrape product listings from an e-commerce site based on a specific search term and page number.
- Inputs:
- Webpage URL:
https://www.example-shop.com/search - Query parameters:
q:wireless headphonespage:2
- Webpage URL:
- Result: The action constructs the URL
https://www.example-shop.com/search?q=wireless+headphones&page=2, fetches the HTML for the second page of search results for "wireless headphones". TheHTMLvariable will hold this content, andSTATUSwill be "SUCCESS".
Example 3: Handling a Non-Existent Webpage
You try to access a webpage that has been moved or deleted.
- Inputs:
- Webpage URL:
https://www.example.com/old-product-page - Query parameters: (Leave empty)
- Webpage URL:
- Result: The action attempts to visit the URL. Since the page no longer exists, the
STATUSvariable will be set to "NOT_FOUND". TheHTMLvariable will likely be empty or contain an error message from the server.
Example 4: Providing an Invalid Web Address
You accidentally type an incomplete or malformed web address.
- Inputs:
- Webpage URL:
example.com/contact - Query parameters: (Leave empty)
- Webpage URL:
- Result: The action immediately detects that "example.com/contact" is not a valid, complete URL (it's missing
http://orhttps://). The action will stop execution and display an error message, and no output variables (HTML,STATUS) will be set.