Parse HTML data return into lists

I have an API endpoint that returns to me the data with HTML tags. I understand how to remove those, but what I want to do is to aggregate them into lists.

For example, there are several sections that are using the

tags and I would like to isolate each string of text between the tags and then to create a list of those strings.

I’ve looked for the last 6 hours at various threads on the internet about using extract with regex, but most are using Python or some other code such as javascript functions that I am not capable of implementing.

Does anybody have an idea of what I could do inside of Bubble?

Why can’t you use JavaScript?

I don’t know how to write it. If I find something online I can usually fudge my way to get it to work in Bubble, but all JS things I saw for this were beyond my abilities.

Depending on exactly how (and how consistently) the HTML is formatted, successive :splitby Bubble expressions might be an option.

If you post a snippet, someone might be able provide a more concrete suggestion.

And of course, there’s also ChatGPT, which might be able to spit out some working regex or JS. :robot:

Thanks @sudsy The splitby is a good idea…I would need to do so in a systematic approach, but worth a try.

An example is below

<h1>Streamlining App Creation: Enhancing Your Task Management</h1><p><img alt="Efficient Development Strategies: Enhancing Your Workload Use" src="[email protected]" /></p><p>Bubble offers an array of applications that you can construct and create your ideas. Locating the proper approach for your intended function may have a considerable result on how many <a href=""><strong>workload units (WU)</strong></a> your app consumes (and therefore, which of Bubble's pricing plans might be ideal for you).</p><p>This piece of writing will provide guidance on how to get the most out of your work and optimize your app to be leaner and more effective. We will be discussing three topics:</p><ul><li>Analyzing the amount of energy expended</li><li>Grasping the amount of activity your application is currently consuming</li><li>Strategies which can lead to increased demand and alternative approaches to achieving more efficient results</li></ul><p>Rather than having a single product available, businesses can benefit from offering a variety of items to their customers. Offering an assortment of goods can help to expand the customer base and increase profits. It is a great strategy for businesses to employ as it helps to broaden the range of products and services they offer.</p><p>It's possible to remove any plagiarism by altering the organization of the text without changing the meaning or context. This can be done by keeping the same semantic significance while switching up the structure. Preserving the markdown formatting is also important.</p><p>It's essential to note that <strong>there's no universal approach to developing an app</strong>. Each app is unique. Nevertheless, optimizing your workload usage and improving the performance of your app and its users is key. In the following sections, we'll provide guidance on how to make your app more efficient, depending on your preferences.</p><h2><strong>What increases the amount of workload?</strong></h2><p>The reality of the situation is that plagiarism is a serious issue in the academic world. It is important to be aware of the potential consequences that can come along with plagiarizing another person's work. To avoid these penalties, it is necessary to ensure that any writing is completely original and properly cited. Taking the time to properly paraphrase and cite other sources is the only way to completely avoid any form of plagiarism.</p><p>Bubble has a method of quantifying the amount of work it does to power your app and this is called the workload. Basically, this term is used to refer to all the tasks your app does while running.</p><p>Further on in this article, we'll look at some examples in more detail, but the main point to keep in mind is this: <strong>only have your app do the necessary work, when it's absolutely required.</strong></p><p>Thus, the primary cause of <em>inefficient</em> utilization of workloads is usually <em>unneeded</em> activity by the app. Frequently, this can be a recurring action your app does more often than necessary. Alternatively, it could be an operation that interacts with an excessive amount of data. (If you have already worked on <a href="">optimizing your app's performance</a>, most of the conclusions you reached should be applicable here as well.)</p><p>In order to begin, you'll need to gain a better understanding of your workload usage. As such, the first step is to locate a suitable starting point.</p><h2><strong>What is the source of the strain on my app's performance?</strong></h2><p>You can find a selection of charts on Bubble to analyze usage patterns and establish the biggest users of your app. To access these metrics, go to the Logs tab within the app and search for App metrics.</p><p>The image above shows a person looking at their phone. They seem to be intently focused on the screen, suggesting they are taking time to engage with the content they are viewing. It is likely that they are using their phone to browse the internet or keep up with their social media accounts.</p><p>The bar graph displays a combined figure of the labor your app has completed in a specific timeframe, while the pie chart supplies a comprehensive analysis of the various components that constitute your total workload. It is also possible to delve into a certain category by selecting it.</p><p><img alt="" src="" /></p><p>The image displays an illustration of a person with a questioning expression on their face. It appears as though they are pondering something, with their finger to their chin.</p>

My goal is to be able to set up some regex patterns or a javascript function to separate out based on the tag type…as there are multiple h2 tags, I’d be looking to separate based on those first, then the paragraph tags and optimally be able to extract values between the image tags as well.

My thoughts are to use your suggestion and splitby the h2 tags and then split by the paragraph tags and use a regex to extract out the image tags.

I’ve got something working to extract out the H1 tag, so would hopefully alter it successfully for the image tag.

Started looking at the manual this afternoon for bulk update API to avoid using recursive workflows to utilize the expression builder and operators.

I’ve looked into an API provider that does it, but it’s too costly per month for what it’s purpose is.

This topic was automatically closed after 70 days. New replies are no longer allowed.