Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

IE page automatically downloads

$
0
0
Hi All,

I was just wondering how I could make AutoIT determine if a webpage prompts up to download a file, atm my code is as follows:


[ autoit ]         
#include <IE.au3> #include <Array.au3> #include <File.au3> If FileExists("file path") Then;you will need to change where the .txt is stored Sleep(400) Else FileWrite("directory path","") EndIf local $links _FileReadToArray("txt file",$links) _ArrayDelete($links, 0) $blocked=InputBox("Insert Message...","Insert Message...") $log=FileOpen("directory path","1");you will need to change where the .txt is stored For $link In $links $oIE = _IECreate($link, 0, 1, 1, 0) ;_IELoadWait($oIE) sleep(150) $title = _IEPropertyGet( $oIE , "title") If StringInStr($title, $blocked) > 0 Then ;blocked FileWriteLine($log,$link&" - Blocked") _IEQuit($oIE) ElseIf StringInStr($title, "Error") Or StringInStr($title, "cannot") Or StringInStr($title, "Not Found") Or StringInStr($title, "Forbidden") > 0 Then ;error FileWriteLine($log,$link&" - "& $title);displays the error in log file _IEQuit($oIE) ElseIf WinExists("File Download") Then ;page attempts to download WinClose("File Download") FileWriteLine($log,$link&" - Attempts to download file, missed")     Else ;missed FileWriteLine($log,$link&" - Missed") _IEQuit($oIE) EndIf Next

Everytime IE loads a webpage which prompts for a download the scripts ends with this error:

WEnd
WEnd^ ERROR


As you can see there are no While Loops in the script.

Thanks.

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>