I try to get text from a site, using javascript and textContent
i use this code
var markets=document.getElementsByClassName('sip-MarketGroup ')
for (var i=0;i<markets.length;i++){
try {
console.log(markets[i].textContent);
} catch (error) {
console.error(error);
}
}
a part of html into the site is this below
<div class="sip-MarketGroupButton sip-MarketGroup_Open ">
<div class="sip-MarketGroupButton_Text " style="">Fulltime Result</div>
<div class="sip-MarketGroupButton_FavouriteButton sip-FavouriteButton ">
<div class="sip-FavouriteButton_SVG "> </div>
</div>
</div>
<div class="gl-MarketGroup_Wrapper ">
<div class="gl-MarketGroupContainer ">
<div class="gl-Market gl-Market_General gl-Market_General-topborder gl-Market_General-pwidth100 ">
<div class="gl-Participant gl-Participant_General gl-Market_General-cn3 ">
<span class="gl-Participant_Name">QPR</span>
<span class="gl-Participant_Odds">12.00</span>
</div>
<div class="gl-Participant gl-Participant_General gl-Market_General-cn3 ">
<span class="gl-Participant_Name">Draw</span>
<span class="gl-Participant_Odds">4.00</span>
</div>
<div class="gl-Participant gl-Participant_General gl-Market_General-cn3 ">
<span class="gl-Participant_Name">Bournemouth</span>
<span class="gl-Participant_Odds">1.36</span>
</div>
</div>
</div>
</div>
and i get
Fulltime ResultQPR12.00Draw4.00Bournemouth1.36
without spaces, how can i get this text but seperated with “;”