Selector

We determine which element in the DOM the data we want to receive is in with the help of a selector. In this way, when we parse the HTML, muninn knows what data it needs to receive.

HTML
<div class="parent">
  <div class="blue">Blue Text</div>
</div>

Let's get the content of the element with the blue class.

Config
{
    "blueText": ".blue" 
}
Output
{
    "blueText": "Blue Text" 
}

Alternative Selector

Now let's specify an alternative selector.

Config
{
    "greenOrBlueText": ".green, .blue"
}

Since there is no element with green class, it will still get the content of the element with blue class.

Last updated