Jump to content

How to grab javascript generated data?


Recommended Posts

Is there a way to grab non-hardcoded but rather javascript generated data from a webpage?

Tried a get request as well as _IEBodyReadHTML but both seem to grab the code without the javascript generated data.

$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$oHTTP.Open("GET", "link", False)
$oHTTP.Send()
$oReceived = $oHTTP.ResponseText
$oStatusCode = $oHTTP.Status
Global $DataArray[10][5]

If $oStatusCode <> 200 Then
    Exit
    MsgBox(1, "Error", "Status Code <> 200")
EndIf

FileWrite(@ScriptDir & "\output.txt", $oReceived)

; ////////

#include <IE.au3>

Local $FullLink = "link"
Local $oIE = _IECreate($FullLink, 0, 0)
_IELoadWait($oIE)
Local $sText = _IEBodyReadHTML($oIE)
FileWrite(@ScriptDir & "\output.txt", $sText)

 

Link to comment
Share on other sites

So as it turns out _IEBodyReadHTML does what I'm looking for, but unfortunately the site seems to have trouble with Internet Explorer - it runs smoothly in Chrome, but in IE it totally bugs out.

I tried the WebDriver UDF but haven't been able to find the option to create a hidden window just like _IECreate does.

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...