JSFiddle - React, Tailwind, and code Playground
HTML
<div class="post-message">
<span class="post-bold">Title</span>
: Movie Title
<span class="post-bold">Year</span>
: 2021
<span class="post-bold">Categories</span>
: Drama, HORROR, Sci Fi, TV Show, Action
<span class="post-bold">Cast</span>
: John Smith, Mary Jane, Neo, Trinity, Morpheus, Mr. Anderson
</div>
JavaScript
var castExists = $('span.post-bold:contains("Cast")');
if (castExists.length) {
var getCast = $("div.post-message").contents().filter(function() { return ($(this).text() === 'Cast');
})[0].nextSibling.nodeValue.substring(3).trim();
alert(getCast);
var actors = getCast.split(', ');
for (var i = 0; i < actors.length; i++) {
alert(actors[i]);
}
}