Didonet Posted December 22, 2007 Share Posted December 22, 2007 Hi, I'm writing a script that download avatars from last.fm of music groups or singers and.. thats my code... I get some orange errors in the SCiTE editor... expandcollapse popupFunc IENavigate($p, $artist) _IENavigate($oIE, "http://last.fm/music/" & StringReplace($artist, " ", "+") & "/+images?page=" & $p) $sHTML = _IEBodyReadHTML($oIE) EndFunc ;==>IENavigate Func SaveImgs($artist) $sImgDir = $avatarsDir & $artist & "\" $oIMGs = _IEImgGetCollection($oIE) For $oImg In $oIMGs If StringInStr($oImg.src, '/serve/160/') Then $sImgUrl = $oImg.src $sImgFileName = $oImg.nameProp If InetGet($sImgUrl, $sImgDir & $sImgFileName) Then If $progress_bar = 100 Then $progress_bar = 0 $saved += 1 $progress_bar += 1 ProgressSet($progress_bar, "[ " & $saved & " ] images saved... " & @CRLF & "[ " & $page & " ] page") Sleep(200) EndIf EndIf Next EndFunc ;==>SaveImgs Func DownloadAvatars($artist, $sImgDir) $saved = False If Not FileExists($sImgDir) Then DirCreate($sImgDir) EndIf ProgressOn("last.fm avatar downloader", $artist & '...', "connecting...", -1, -1, 16 + 2) $oIE = _IECreate("about:blank", 0, 0, 1) IENavigate($page, $artist) Sleep(5000) SaveImgs($artist) While StringInStr($sHTML, 'nextlink') $page += 1 IENavigate($page, $artist) SaveImgs($artist) WEnd _IEQuit($oIE) If $saved = False Then DirRemove($sImgDir) ProgressSet(0, 'No images found...') Sleep(1000) ProgressOff() Else ProgressSet(100, 'Downloading pictures for "' & $artist & '"...', "downloaded...") Sleep(1000) ProgressOff() EndIf EndFunc ;==>DownloadAvatars Link to comment Share on other sites More sharing options...
Nahuel Posted December 22, 2007 Share Posted December 22, 2007 And what are these "strange errors"? Link to comment Share on other sites More sharing options...
Didonet Posted December 22, 2007 Author Share Posted December 22, 2007 now it shows one error... o_Ostrange... before a few minutes it shows more than 4-5 errors... like to use _IEErrorHandlerRegister() and... problems with attaching, problem with IEIsObj (or something like that) and more...Now its that:--> IE.au3 V2.3-1 Warning from function _IECreate (Foreground Window Unlock Failed!) Link to comment Share on other sites More sharing options...
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