I'm having trouble with getting texts that are in element to array. The structure I'm trying to 'extract' is looking something like this:
<div>
text text text text
<h2> title </h2>
text2 text2 text2
<img>
<br>
<br>
text3 text3 text3
<h2> title 2</h2>
text4 text4 text4
</div>
the result I'm looking for is array:
['text text text', 'text2 text2 text2', 'text3 text3 text3', 'text4 text4 text4']
I can't edit the HTML structure. And I don't have idea how to get this data to an array. I've only tried .text() from jquery, but that's not the way, and I didn't found anything in google, that would help.
htmlelements?