# Parsing HTML extracted from RSS to post to Discord

**URL:** https://community.make.com/t/parsing-html-extracted-from-rss-to-post-to-discord/24653
**Category:** Questions
**Tags:** parse
**Created:** [January 18, 2024, 5:25pm UTC](https://community.make.com/t/parsing-html-extracted-from-rss-to-post-to-discord/24653 "2024-01-18T17:25:26Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Hichem](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/hichem/32/23722_2.png) [@Hichem](https://community.make.com/u/Hichem)
#### Post date: [January 18, 2024, 5:25pm UTC](https://community.make.com/t/parsing-html-extracted-from-rss-to-post-to-discord/24653/1 "2024-01-18T17:25:26Z")

</div>

Hi there,

I’m really excited to learn how powerful is Make 🙂

I’m trying to achieve the following scenario :  
Every day a list of events is posted on this website

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/c/1/c1f3155211c41aa6450a4094935076d94b103a9c.png)  
there is an RSS feed available here : [https://monopolygo.wiki/tag/events/rss](https://monopolygo.wiki/tag/events/rss)  
The objectif is with these information to post a message in a discord channel like this :  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/c/4/c460f2801cb9c816675227781557aa1061596abf.png)

I’ve created a scenario in Make with the Retrieve RSS Feed Items module.  
I successfully get as output the description field where the HTML contains all needed information. it looks like :

```auto
//some code before....

<div class="event-container" style="flex-direction: row;margin-bottom: 1em;padding:1em;background-color: #f5f5f5;border-radius:5px;box-shadow: 0 1px 2px #b9b9b9;justify-content: space-between;align-items:center;">
  <div>
    <img alt="Mega Heist" style="max-height:50px" src="https://cdn.monopolygo.wiki/commodities/MegaHeist.png">
    <span style="font-weight:bold;">Mega Heist</span>
  </div>
  <div style="display: flex;flex-direction: column;">
    <div>
        <span class="local-date" data-date="1705561200.0">02:00AM</span> —
        <span class="local-date" data-date="1705582740.0">07:59AM EST</span>
    </div>
    <span><b>Duration:</b> 01:00:00</span>
  </div>

</div>

<div class="event-container" style="flex-direction: row;margin-bottom: 1em;padding:1em;background-color: #f5f5f5;border-radius:5px;box-shadow: 0 1px 2px #b9b9b9;justify-content: space-between;align-items:center;">
  <div>
    <img alt="Cash Grab" style="max-height:50px" src="https://cdn.monopolygo.wiki/commodities/CashGrab.png">
    <span style="font-weight:bold;">Cash Grab</span>
  </div>
  <div style="display: flex;flex-direction: column;">
    <div>
        <span class="local-date" data-date="1705572000.0">05:00AM</span> —
        <span class="local-date" data-date="1705582740.0">07:59AM EST</span>
    </div>
    <span><b>Duration:</b> 00:15:00</span>
  </div>

</div>

//some code after

```

I have several div with class “event-container” that I want to parse to get from each one :

- name of the event
- url of the image
- start time
- end time
- duration

RSS feed module works fine, Discord module works fine but I’m stuck on how to format the messages

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/b/7/b7fa2da47879342b1a4ddfb402f43f5fa2dbec4b.png)

What would be the best way to do that ? 🤔

Any help would be greatly appreciated.

Thanks in advance

---

<div class="post-metadata">

### Author: ![samliew](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/samliew/32/13327_2.png) [@samliew](https://community.make.com/u/samliew)
#### Post date: [January 19, 2024, 1:42am UTC](https://community.make.com/t/parsing-html-extracted-from-rss-to-post-to-discord/24653/2 "2024-01-19T01:42:20Z")

</div>

Welcome to the Make community!

You can use a Text Parser “[Match Pattern](https://www.make.com/en/help/tools/text-parser)” module with this regular expression pattern

`alt="(?<name>[^"]+)"[\w\W]+?src="(?<img>https:[^"]+)"[\w\W]+?(?<start>\d+:\d+[AP]M)<\/span>[\w\W]+?(?<end>\d+:\d+[AP]M)(?: \w+)<\/span>[\w\W]+?Duration:<\/b>\s+(?<duration_hours>\d+):(?<duration_mins>\d+):\d+<\/span>`

Regex test: [https://regex101.com/r/6RJyzP](https://regex101.com/r/6RJyzP)

## Important Info

- ⚠ **Global match** must be set to YES!

# Screenshot

 ![Screenshot_2024-01-19_090130](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/d/8/d827e904b9f449b56c226277a31359f89fa65e1f.png)

# Output

 ![Screenshot_2024-01-19_090153](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/6/f/6f680eae466ec98ad66389ff562aab7414b22268.png)

For more information, see [Text Parser](https://www.make.com/en/help/tools/text-parser) in the Make Help Center:

> **Match Pattern**  
> The **Match pattern** module enables you to find and extract string elements matching a search pattern from a given text. The search pattern is a [regular expression](https://en.wikipedia.org/wiki/Regular_expression) (aka regex or regexp), which is a sequence of characters in which each character is either a metacharacter, having a special meaning, or a regular character that has a literal meaning.
> 
> - The complete list of metacharacters can be found on the [MDN web docs website](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions).
> - For a tutorial on how to create regular expressions, we recommend the [RegexOne website](https://regexone.com/).
> - For an easy, quick regex generator, try the [Regular Expressions generator](https://regex-generator.olafneumann.org/).
> - For experimenting with regular expressions, we recommend the [regular expressions 101 website](https://regex101.com/). Just make sure to tick the ECMAScript (JavaScript) FLAVOR in the left panel.

* * *

> [@Hichem](#):
>
> I’m stuck on how to format the messages

In what way are you stuck? Please provide additional information on how you are stuck.

## 1. Screenshots of module fields and filters

Please share screenshots of relevant module fields and filters in question? It would really help other community members to see what you’re looking at.

You can upload images here using the Upload icon in the text editor:  
 ![Screenshot_2023-10-07_111039](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/2/0/20b53cdf28d223e85fc9654c350eadebd37f5d3c.png)

## 2. Scenario blueprint

Please export the scenario blueprint file to allow others to view the mappings and settings. At the bottom of the scenario editor, you can click on the three dots to find the Export Blueprint menu item.

 ![Screenshot_2023-08-24_230826](https://europe1.discourse-cdn.com/flex013/uploads/make/original/2X/2/2ff55ee04419049c127f183db2b3eebfbbbbfc64.png)  
(Note: Exporting your scenario will not include private information or keys to your connections)

Uploading it here will look like this:

> blueprint.json (12.3 KB)

## 3. And most importantly, Output bundles

Please provide the output bundles of the modules by running the scenario, then click the white speech bubble on the top-right of each module and select “Download output bundles”.

 ![Screenshot_2023-10-06_141025](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/2/8/2876156ab3ea5bc9e40bbc0edfb9f025406b7c48.png)

### A.

Save the bundle contents in your text editor as a `bundle.txt` file, and upload it here into this discussion thread.

Uploading it here will look like this:

> bundle.txt (12.3 KB)

### B.

If you are unable to upload files on this forum, alternatively you can paste the formatted output bundle in this manner:

- Either add three backticks ````` before and after the code, like this:

- Or use the format code button in the editor:  
 ![Screenshot_2023-10-02_191027](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/b/4/b485b6572c7a1c438f9b191c54e63d351008304c.png)

Providing the output bundles will allow others to _replicate_ what is going on in the scenario even if they do not use the external service.

Following these steps will allow others to assist you here. Thanks!

---

<div class="post-metadata">

### Author: ![Hichem](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/hichem/32/23722_2.png) [@Hichem](https://community.make.com/u/Hichem)
#### Post date: [January 19, 2024, 8:47am UTC](https://community.make.com/t/parsing-html-extracted-from-rss-to-post-to-discord/24653/3 "2024-01-19T08:47:28Z")

</div>

@samliew

You are awesome ! This is exactly what I was looking for 😲

![Simon Cowell Wow GIF by America's Got Talent](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/7/0/7069bf968b75ce453e7d9e792bb5f27abb2eb2ba.webp)

Here is the posted message to Discord, I just have now to format it a bit but the big part is here.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/9/6/961dbe71fa58cf355fb791e4ed39a6a56cb172c9.png)

One just last thing, there are 7 events to retrieve but only 6 have been posted to Discord and I have this RuntimeError warning :

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/d/4/d49da82cefa784ed2dc5e98fcbc9bfb90966a258.png)

What does it means exactly ?

Thanks again @samliew 🙏

---

<div class="post-metadata">

### Author: ![samliew](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/samliew/32/13327_2.png) [@samliew](https://community.make.com/u/samliew)
#### Post date: [January 19, 2024, 10:54am UTC](https://community.make.com/t/parsing-html-extracted-from-rss-to-post-to-discord/24653/4 "2024-01-19T10:54:26Z")

</div>

That means you can either aggregate to text so that you only send a single message, or you can use a sleep module to space out the messages because you cannot post so many at the same time.

---

<div class="post-metadata">

### Author: ![Hichem](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/hichem/32/23722_2.png) [@Hichem](https://community.make.com/u/Hichem)
#### Post date: [January 19, 2024, 11:52am UTC](https://community.make.com/t/parsing-html-extracted-from-rss-to-post-to-discord/24653/5 "2024-01-19T11:52:35Z")

</div>

I’m not sure how to do this.  
I’v added a “Compose string” and “Text aggregator” before the “Discord” module.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/a/3/a36f8992229b88291801c7d7dc21649164ca18d9.png)

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/4/8/485fdea826e5bb88e3e1509e83b359561df98b3c.png)

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/2/1/21db55e9bece2004a87ac62e6777f23eed024bdf.png)

but I still have 7 operation in the “Discord” output.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/6/b/6baee75c226d39196d42106bea698a16e642a8b1.png)

How ever I don’t have the warning message anymore.  
Was that your suggestion @samliew ? I’m doing it right ?

Thanks in advance.

PS : I have upgraded now from the Free to Core plan, in order to avoid any limitation…

---

<div class="post-metadata">

### Author: ![samliew](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/samliew/32/13327_2.png) [@samliew](https://community.make.com/u/samliew)
#### Post date: [January 19, 2024, 12:32pm UTC](https://community.make.com/t/parsing-html-extracted-from-rss-to-post-to-discord/24653/6 "2024-01-19T12:32:16Z")

</div>

Every result (item/record) from a search module will output a bundle. To “combine” them into a single structure, you’ll need to use an aggregator of some sort.

[Aggregators](https://www.make.com/en/help/modules/aggregator.html) are modules that accumulate multiple bundles into one single bundle. An example of a commonly-used aggregator module is the [Array aggregator](https://www.make.com/en/help/tools/flow-control.html#array-aggregator) module.

But to aggregate, you need to set the “Source Module” field correctly to the module where all the bundles are **CREATED**. Usually this is a Search or Iterator module, but in your case it’s the Text Parser module.

You can click the white circle to see that there are that many bundles coming out of it.

---

<div class="post-metadata">

### Author: ![Hichem](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/hichem/32/23722_2.png) [@Hichem](https://community.make.com/u/Hichem)
#### Post date: [January 19, 2024, 1:25pm UTC](https://community.make.com/t/parsing-html-extracted-from-rss-to-post-to-discord/24653/7 "2024-01-19T13:25:39Z")

</div>

Thanks for you feedback @samliew 🙏

I’ve tried to set up what you sais but I’m a bit confused as it still outputing 7 bundles after the array aggregator…

here is my scenario :

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/9/d/9dd8f65e0174973a073f603bf102c2ec4f595920.png)

the iterator module :

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/2/9/29bb0e20fcab1d726ac6307345450fcfa8e12c1e.png)  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/7/8/780468f34a55335c470bae356f66fea068ba9760.png)

the array aggregator module :

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/3/2/32753e0a5fb6062b7b1562964c49c968da999d3e.png)  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/a/0/a09aba6fed8dffcdd9003ff528cee8ae84a333d3.png)

it’s weird no ? 🤔

---

<div class="post-metadata">

### Author: ![samliew](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/samliew/32/13327_2.png) [@samliew](https://community.make.com/u/samliew)
#### Post date: [January 19, 2024, 2:32pm UTC](https://community.make.com/t/parsing-html-extracted-from-rss-to-post-to-discord/24653/8 "2024-01-19T14:32:39Z")

</div>

In your aggregator, set the source module to the text parser.

---

<div class="post-metadata">

### Author: ![Hichem](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/hichem/32/23722_2.png) [@Hichem](https://community.make.com/u/Hichem)
#### Post date: [January 19, 2024, 2:46pm UTC](https://community.make.com/t/parsing-html-extracted-from-rss-to-post-to-discord/24653/9 "2024-01-19T14:46:34Z")

</div>

Thank you so much @samliew it works now.

![Thank U Reaction GIF by Chris Gethard](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/2/b/2bec5378cfd5af91befd48cc6ec444e4a2906ad7.webp)

---

<div class="post-metadata">

### Author: ![Make\_Bot](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/make_bot/32/14661_2.png) [@Make\_Bot](https://community.make.com/u/Make_Bot)
#### Post date: [February 2, 2024, 2:58pm UTC](https://community.make.com/t/parsing-html-extracted-from-rss-to-post-to-discord/24653/10 "2024-02-02T14:58:26Z")

</div>


