Jump to content

How to get the source after executing javascript


boooooom
 Share

Recommended Posts

I'm trying to get the HTML code after executing javascript in IE. Here is my code.

$url = "http://example.com"
$oIE = _IECreate($url)
Sleep(3000) ;waiting for executing javascript. But useless.
$oFrame = _IEFrameGetCollection($oIE, 0)
$sCode &= _IEPropertyGet($oFrame, "innerhtml") & @CRLF

Then, I get this error.

"C:\Program Files (x86)\AutoIt3\Include\IE.au3" (2308) : ==> The requested action with this object has failed.:
$oTemp = $oObject.document.body
$oTemp = $oObject^ ERROR

After executing javascript, when I view source in IE, there are HTML code like below.

<html>
<head>
...
</head>
<body>
...
</body>
</html>

What should I do?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...