本帖最后由 jycel 于 2010-1-13 15:05 编辑
回复 4# bob
我试了下可以读取,但是我换成我这地址读取就空的!不知道是获取图片地址不对?
http://www.autoitx.com/forum.php ... p;extra=&page=2例子中验证码图片是BMP图片,我这个是GIF的!
还有就是点击登陆按钮没反应!#include <IE.au3>
#include <OCR.au3>
Dim $i=0
$oIE = _IECreate ("http://www.4688.com.cn",1,1,1)
$oImgs = _IEImgGetCollection ($oIE)
For $oImg In $oImgs
$i+=1
If $oImg.src="http://www.4688.com.cn/Modules/RandomImage.aspx?colorb=999999&colorf=000000" Then
$oPic = $oIE.Document.body.createControlRange()
$oPic.Add($oImg)
$oPic.execCommand("Copy")
$img = ClipGet()
EndIf
Next
$a_Image = myReadImageToArray($img, True, 1, 0xeeeeee)
$s_code_string = myArrarOCR(@ScriptDir&"\CodeFont.txt", $a_Image, 1, 4, 5, "", 0, 5, 0, 0)
$o_form = _IEFormGetObjByName ($oIE, "aspnetForm")
$o_login = _IEFormElementGetObjByName ($o_form, "Blue30Login$txtLoginAccount")
$o_login1 = _IEFormElementGetObjByName ($o_form, "Blue30Login_txtEmpAccount")
$o_password = _IEFormElementGetObjByName ($o_form, "Blue30Login_txtPassword")
$dt_password = _IEFormElementGetObjByName ($o_form, "Blue30Login_txtExtCode")
$o_signin = _IEFormElementGetObjByName ($o_form, "Blue30Login$btnLogin")
$username = "jycel"
$username1 = "jycel"
$password = "123456"
; Set field values and submit the form
_IEFormElementSetValue ($o_login, $username)
_IEFormElementSetValue ($o_login1, $username1)
_IEFormElementSetValue ($o_password, $password)
_IEFormElementSetValue ($dt_password, $s_code_string)
_IEAction ($o_signin, "click")
MsgBox(0,"",$s_code_string)
Exit
|