#include $Url = 'https://rda.ucar.edu/' $Url2 = 'https://rda.ucar.edu/datasets/ds083.2/index.html#sfol-wl-/data/ds083.2?g=22017' ;$Url2 = "https://rda.ucar.edu/data/ds083.2/grib2/2017/2017.07/fnl_20170724_06_00.grib2" direct download link once you are logged on. $User = 'xxxxxxxxxx' $Pwd = 'xxxxxxx' $test = _IEAutoLogin($Url, $User, $Pwd) Func _IEAutoLogin($sUrl, $sUsername, $sPwd) ;funkey 09.09.09 $oIE = _IECreate($sUrl) _IEErrorNotify(False) _IEErrorHandlerRegister() $oForms = _IEFormGetCollection($oIE) If @error Then Return SetError(1, _IEErrorHandlerDeRegister(), $oIE) ;'no forms --> no login' Else $Index = 0 For $oForm In $oForms $oFormElements = _IEFormElementGetCollection($oForm) If IsObj($oFormElements) Then $IndexElement = 0 For $oElement In $oFormElements If $oElement.Type = 'password' Then $oPwd = _IEFormElementGetObjByName($oForm, $oElement.Name) _IEFormElementSetValue($oPwd, $sPwd) For $i = $IndexElement - 1 To 0 Step -1 $oUser = _IEFormElementGetCollection($oForm, $i) If $oUser.Type = 'text' Then _IEFormElementSetValue($oUser, $sUsername) ExitLoop EndIf Next If $oForm.action <> "0" And Not StringInStr($oForm.action, '.php') Then ;submit _IEFormSubmit($oForm, 0) _IELoadWait($oIE) Else ;click For $i = $IndexElement + 1 To $IndexElement + 10 ;check the next 10 elements $oButton = _IEFormElementGetCollection($oForm, $i) If $oButton.Type = 'submit' Then _IEAction($oButton, "click") ExitLoop EndIf Next EndIf Return SetExtended(_IEErrorHandlerDeRegister(), $oIE) EndIf $IndexElement += 1 Next EndIf $Index += 1 Next EndIf Return SetError(2, _IEErrorHandlerDeRegister(), $oIE) ;no password-field found EndFunc ;==>_IEAutoLogin ;=============================================go to the download links============== Sleep(3000) Opt("WinTitleMatchMode", 2) $a = " - Internet Explorer" Do Sleep(5) Until WinExists($a) $b = WinGetHandle($a) WinActivate($B) $c = _IEAttach ($b, "HWND") _IENavigate ($c, $Url2) ; take me to the download links ;================================================================================================ ;~ #include ;~ #include ;~ #include ;~ ; Download a file in the background. ;~ ; Wait for the download to complete. ;~ Example() ;~ Func Example() ;~ ; Save the downloaded file to the temporary folder. ;~ ;Local $sFilePath = _WinAPI_GetTempFileName(@TempDir) ;~ Local $sFilePath = "D:\MalutaDownloads\" ;~ ; Download the file by waiting for it to complete. The option of 'get the file from the local cache' has been selected. ;~ Local $iBytesSize = InetGet("https://rda.ucar.edu/data/ds083.2/grib2/2017/2017.07/fnl_20170724_06_00.grib2", $sFilePath & "fnl_20170724_06_00.grib2", $INET_DOWNLOADWAIT);, $INET_FORCERELOAD) ;~ ; Retrieve the filesize. ;~ Local $iFileSize = FileGetSize($sFilePath) ;~ ; Display details about the total number of bytes read and the filesize. ;~ MsgBox($MB_SYSTEMMODAL, "", "The total download size: " & $iBytesSize & @CRLF & _ ;~ "The total filesize: " & $iFileSize) ;~ ; Delete the file. ;~ ;FileDelete($sFilePath) ;~ EndFunc ;==>Example