Forgive me if I've missed something obvious here, I'm new to AutoIt and figuring out the IE Management is taking a lot of trial and error.
Basically, I'm trying to get this script to log into my comics.com account and save an image to my hard drive. The problem I'm running into now is that the image isn't listed as either a .gif or .jpg - instead it's fed by a script listed as something like "archiveViewer?stripId=254232"
Usually it's a .gif file, but once in a while it's a .jpg - and I want to make sure I download each file with the proper extension. I don't think I can do that properly using InetGet, but if I'm wrong about that let me know.
Explorer's "Save As" function seems to know the proper file type for saving the image, so I thought I'd try to use that and have the script just enter the proper save path minus the file extension.
Unfortunately, that doesn't seem to work, the "Save As" dialog opens up, but nothing gets typed in. I'm guessing that there's something about the IE Management scripts that forbids direct entry like that, am I right?
In any case, this is what the script looks like right now. Does anybody have any suggestions?
#include <IE.au3>
$oIE = _IECreate ("https://members.comics.com/members/registration/showLogin.do")
_IELoadWait ($oIE)
$oForm = _IEFormGetObjByName ($oIE, "userForm")
$oEmail = _IEFormElementGetObjByName ($oForm, "email")
$oPass = _IEFormElementGetObjByName ($oForm, "password")
_IEFormElementSetValue ($oEmail, "myemail")
_IEFormElementSetValue ($oPass, "mypassword")
$oSubmit = _IEGetObjByName ($oIE, "sign in")
_IEAction ($oSubmit, "click")
_IELoadWait ($oIE)
_IENavigate ($oIE, "http://members.comics.com/members/extra/archive/firstStripInMonth.do?comicId=901&yyyymm=190001&comic=cowandboy")
$sHTML = _IEDocReadHTML ($oIE)
$oImgs = _IEImgGetCollection ($oIE)
$oLinks = _IELinkGetCollection ($oIE)
$newlink = "NONE"
For $oLink In $oLinks
If StringInStr($oLink.href, "?date=") Then
$newlink = $oLink.href
EndIf
Next
$newimage = "NONE"
For $oImg In $oImgs
If StringInStr($oImg.src, "archiveViewer") Then
$newimage = $oImg.src
EndIf
Next
_IENavigate ($oIE, $newimage)
_IELoadWait ($oIE)
_IEAction ($oIE, "saveas")
WinWaitActive("Save Picture")
Send("D:\allpics\comics\CowAndBoy\1")