Suppose that pop-ups on the site are NOT blocked. PS I think it is also important to note that the domain is the same. That is, you need to take info from the same site.

  • Required in this way? If not, use AJAX. - wcobalt
  • one
    Yes, of course, because the site is not mine, I just write a script to work with one portal. - DeuS7

1 answer 1

Draft functions for solving your problem in the way you need:

function loadContent(link, callback) { var tab = window.open(link); tab.onload = function() { callback(tab.document.body.innerHTML); tab.close(); }; } 

Call example

 loadContent('https://ya.ru/', function(text) { console.log(text); }); 

However, to solve such problems correctly using AJAX requests.

  • I agree, but the server and the site are not mine - I only need info for the script and experience. - DeuS7