Search code examples
autoit

How to download source code of website


#include <IE.au3>
#include <Inet.au3>

call("logowanie")
Sleep(4000)

Func Logowanie()
    Global $oie= _IECreate("http://pl.ikariam.gameforge.com/")
    Local $login= _IEGetObjByName($oie,"name")
    Local $haslo= _IEGetObjByName($oie,"password")
    Local $przycisk= _IEGetObjById($oie,"loginBtn")
    Local $serwer= _IEGetObjByName($oie,"uni_url")
    _IEFormElementSetValue($login,"<mylogin>")
    _IEFormElementSetValue($haslo,"<mypassword>")
    _IEFormElementSetValue($serwer,"s30-pl.ikariam.gameforge.com")
    _IEAction($przycisk,"click")
EndFunc

This code logs me in to the website but I don't know how to download the website's source code to do some stuff. Could you help?


Solution

  • You can read the source of a website using _IEDocReadHTML:

    $sHtml = _IEDocReadHTML($oie)
    ConsoleWrite($sHtml)