Jump to content

WinHttp.WinHttpRequest.5.1 - Need help to get HTML


Recommended Posts

Hello, With func i have i do not get HTML file, i get bit something else not sure tho.

Func Http()
Local $URLSteam = $url
Local $oHttp = ObjCreate("WinHttp.WinHttpRequest.5.1")
$oHttp.Open("GET", $URLSteam, False)
$oHttp.SetRequestHeader("User-Agent", "Mozilla/4 (Windows; U; Windows NT 6.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 4.0.20506)")
$oHttp.Send()
Global $sData = $oHttp.ResponseText
Local $Use_Agent = 'Mozilla/4.0 (Windows NT 6.1; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0'
Local $aArray_32bit_Icons = _StringBetween($sData, 'avatar" src=', '" alt=')
_ArrayDisplay($aArray_32bit_Icons)
End func

$sData returns $oHttp.ResponseText but i need something like $oIE.document.body.innerText
What i need is to see html

$oHttp.ResponseText returnes data that i could use but sometimes it misses info between <span class="re0">588</span> but this 588 is what i need to get. $oHttp.ResponseText does not wait for info to load, but with this $oIE.document.body.innerText it waits and i get this info.

i suppose, this might work to, but i get unreadable text.
I cant use IE.au3 

$blah = InetGet($URL,@MyDocumentsDir & "\" & @year & "-" & @MON & "-" & @MDAY & "--" & @HOUR & @MIN & ".html")

 

Edited by dersiniar
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...