OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Read external HTML from url including script-content

  • Thread starter Thread starter Lara
  • Start date Start date
L

Lara

Guest
I want to read an external HTML page after JS scripts of this page are executed.

When I read the page as usual it doesn't includes content that is added by JS script of this page later.

How is this possible?

Code:
const xmlHttp = new XMLHttpRequest.XMLHttpRequest()
xmlHttp.open("GET", path)
        xmlHttp.onreadystatechange = function () {
    if (xmlHttp.readyState === 4) 
        if (xmlHttp.status === 200) 
            callback(JSON.parse(xmlHttp.responseText))
}
xmlHttp.send()

<p>I want to read an external HTML page after JS scripts of this page are executed.</p>
<p>When I read the page as usual it doesn't includes content that is added by JS script of this page later.</p>
<p>How is this possible?</p>
<pre><code>const xmlHttp = new XMLHttpRequest.XMLHttpRequest()
xmlHttp.open("GET", path)
xmlHttp.onreadystatechange = function () {
if (xmlHttp.readyState === 4)
if (xmlHttp.status === 200)
callback(JSON.parse(xmlHttp.responseText))
}
xmlHttp.send()
</code></pre>
 

Latest posts

D
Replies
0
Views
1
Dhanushka Amarakoon
D
S
Replies
0
Views
1
Shikhar Ambashta
S
Top