Scrapping of HTML with pure Javascript

2

Hello, I have an html that has the following sample sequence:

<links class="canais-teste"> CANAL 1 <links/>

There are about 80 excerpts of these, I wanted to get only the contents of these tags, in the case of "CHANNEL1", how can I do this with pure javascript?

    
asked by anonymous 03.03.2017 / 16:55

1 answer

1

var links = document.getElementsByTagName('links');
for (let i = 0 ; i < links.length ; i++){
  console.log(links[i].innerHTML);
}
<links class="canais-teste"> CANAL 1 </links>
<links class="canais-teste"> CANAL 2 </links>
<links class="canais-teste"> CANAL 3 </links>
    
03.03.2017 / 17:48