mrdragon Posted November 1, 2006 Posted November 1, 2006 (edited) Okay, so I need to have autoit save a webpage for me 2x daily. I have the program written already and I have been using it for about 6 months as a scheduled task. I recently upgraded to IE7 and it seems to not want to save the page. Here is the code I have been using that has recently stopped working: ;Run and open Internet Explorer to the site needed and saving. ; Run IE Run("C:\Program Files\Internet Explorer\iexplore.exe [url=http://www.mysitename.com/foldername/filename.asp")]http://www.mysitename.com/foldername/filename.asp")[/url] ; We wait the webpage here WinWaitActive("http://www.mysitename.com/foldername/filename.asp - Microsoft Internet Explorer") Sleep(5000) ; Save it Send("!f") Send("a") $blah = InetGet("http://www.mysitename.com/foldername/filename.asp",@MyDocumentsDir & "\" & @year & "-" & @MON & "-" & @MDAY & "--" & @HOUR & @MIN & ".html") ; Now quit by pressing Alt-f and then x (File menu -> Exit) Send("!f") Send("x") It seems to me that the upgrade to IE7 has stopped this particular function from working. The alt+f function still brings up the file menu and letter code for save page is still the same. Does anyone have any suggestions that they can offer? Thank you. Edited November 1, 2006 by mrdragon
Hasher Posted November 9, 2006 Posted November 9, 2006 How about something more simple InetGet("http://www.hotscripts.com/Detailed/48822.html","48822.html",1,1) While @InetGetActive TrayTip("Downloading", "Bytes = " & @InetGetBytesRead, 10, 16) Sleep(250) Wend FileMove(@ScriptDir & "\48822.html", @MyDocumentsDir & "\" & @year & "-" & @MON & "-" & @MDAY & "--" & @HOUR & @MIN & ".html") I only started using AutoIT a few days back so may not be best solution Firefox's secret is the same as Jessica Simpson's: its effortless, glamorous style is the result of shhh extensions!
no925 Posted November 10, 2006 Posted November 10, 2006 I might be really stupid here but if your code sample is correct it wont get past the wait. WinWaitActive("http://www.mysitename.com/foldername/filename.asp - Microsoft Internet Explorer") as IE v7 now has the title of "Windows Internet Explorer" easily overlooked but a pain as all scripts need recoding. Your wait would be. WinWaitActive("http://www.mysitename.com/foldername/filename.asp - Windows Internet Explorer") To get around this for future upgrades just WinWaitActive("http://www.mysitename.com/foldername/filename.asp") Also read help on WinTitleMatchMode as long as you have not changed it then the default does not need an exact title just matching it to the beginning Hope this helps! Richard
mikehunt114 Posted November 10, 2006 Posted November 10, 2006 (edited) The IE functions would be very good at this.... #include <IE.au3> $url = "www.mysitename.com/foldername/filename.asp" $oIE = _IECreate($url, 1) $oIE.document.execCommand ("SaveAs") ; or _IEAction($oIE, "saveas") ; then navigate to wherever you want to save it, then save it $oIE.quit ; or _IEAction("quit") Edited November 10, 2006 by mikehunt114 IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now