#include <IE.au3>
#include <Array.au3>
$iCount = 0
$sString = 'x^2=25'
$sUrl = 'http://www.wolframalpha.com/input/?i='
$oIE = _IECreate($sUrl & $sString)
$oDivs = _IETagNameGetCollection($oIE, 'div')
Dim $aResult[@extended + 10][3]
For $oDiv In $oDivs
If StringRegExp($oDiv.id, '^pod_') Then
$iCount += 1
$oH2 = _IETagNameGetCollection($oDiv, 'h2', 0)
$aResult[$iCount][0] = $oH2.innertext
$oIMG = _IETagNameGetCollection($oDiv, 'img', 0)
$aResult[$iCount][1] = $oIMG.src
$aResult[$iCount][2] = $oIMG.alt
$oIMG = _IETagNameGetCollection($oDiv, 'img')
If @extended = 2 Then
$iCount += 1
$oIMG = _IETagNameGetCollection($oDiv, 'img', 1)
$aResult[$iCount][1] = $oIMG.src
$aResult[$iCount][2] = $oIMG.alt
EndIf
EndIf
Next
If $iCount Then
ReDim $aResult[$iCount + 1][3]
$aResult[0][0] = $iCount
_ArrayDisplay($aResult)
For $i = 1 To $aResult[0][0]
If Not $aResult[$i][1] Then ContinueLoop
$hDownload = InetGet($aResult[$i][1], @ScriptDir & '\' & $i & '.gif', 1, 1)
Do
Sleep(10)
Until InetGetInfo($hDownload, 2)
InetClose($hDownload)
Next
Else
MsgBox(16, 'Error', 'Error')
EndIf