How do you copy the text from the page to the variable?



  • <meta charset="UTF-8" />
    <html lang="en">
    <script src="https://code.jquery.com/jquery-3.6.0.js"></script>
    
    
       <script>
        $.getJSON('тут json', function(data) {
    
            var text = `${data.hls}
                        `
            $(".mypanel").html(text);
        });
        </script>
    
    <body>
      <h>#EXTM3U<br></h>
      <h>#EXTINF:-1 ,Первый канал<br></h>
      <h class="mypanel">#EXTINF:-1 ,Россия 1<br></h>
    
          <script>
    window.addEventListener('load', () => {
      const allText = document.body.innerText;
    console.log(allText);
    });
        </script>
    
    </body>
    </html>
    

    The code water goes to the consoles on the left. It's the text with the right of the console.

    Картинка

    Not the whole page was copied into the variable.
    I didn't look at the variables like I'd imagine.
    Thanks for earlier.



  • window.addEventListener('load', () => {    
        $.getJSON('тут json', function(data) {                
            $(".mypanel").html(data.hls);
    
            const allText = document.body.innerText;
            console.log(allText);
        });
    });
    

    Loading will require a bribery function getJSONwhich will add the data to the divine and then read the same text



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2