Import HTML with Regex in Google Sheets with Chalkline Functions
Introduction
In Google Sheets, you may be seeking a custom function that can parse HTML content using regular expressions. If so, you've come to the right place. My latest Chalkline update introduces my first custom function for Google Sheets, designed to help you achieve this goal.
Installation
Install from Google Workspace Marketplace
YouTube
If you're more of a visual learner, watch this video for step-by-step instructions. While you're there, consider subscribing to my channel for future updates and content.
Function List
Upon installing the Google Sheets add-on, access custom functions by typing "=CL_". All custom functions in this add-on start with "CL_".
- CL_IMPORT_HTML - Unlike the native IMPORT_HTML function, this feature can analyze the HTML content using the prowess of regular expressions, thus enabling you to extract data beyond just tables or lists.
CL_IMPORT_HTML
In this demonstration, we utilize the custom function CL_IMPORT_HTML to retrieve information about the installations of the add-on. This data is obtained from the add-on installation page on the Google Marketplace Store. To test the feature, you can input the following parameters:
- url - “https://workspace.google.com/marketplace/app/chalkline/467201976339”
- regex - “<div aria-label="".+this app\."">([^<]+)<\/div>”
- flags - “i”
* Due to the grouping of the installation in the regular expression parameter, the function will return two values. This allows you to index the result if desired.
* When utilizing the regex parameter, it's important to pay close attention to how double quotes should be handled, especially if they are present within the parameter itself.
Chalkline Playlist (Follow for More Updates)
Links
Hire Me on Upwork Donate YouTube Github Twitter / X Instagram Upwork Projects
Comments
Post a Comment