PDA

Показать полную графическую версию : html Таблицу в массив


serg-pl-1
16-08-2010, 12:41
У меня есть вот такой кусок кода

#include <IE.au3>
#include <Array.au3>

Global $oIE
_Login("http://voyna-plemyon.ru", "-=Смольный=-", "123456", "Мир 1")

$oTable = _IETableGetCollection($oIE, 0)
$aTableData = _IETableWriteToArray($oTable)
_ArrayDisplay($aTableData)

Func _Login($sURL, $sLogin, $sPass, $sWorld)
$oIE = _IECreate($sURL,0 ,1)
$oLogin = _IEGetObjById($oIE, "user")
$oPass = _IEGetObjById($oIE, "password")
_IEFormElementSetValue($oLogin, $sLogin)
_IEFormElementSetValue($oPass, $sPass)

$oLinks = _IELinkGetCollection($oIE)
For $oLink In $oLinks
$sLinkText = _IEPropertyGet($oLink, "innerText")
If StringInStr($sLinkText, "Вход") Then
_IEAction($oLink, "click")
EndIf
Next

; Listener
While _SelectWorld($sWorld)
Sleep(100)
WEnd

_IELoadWait($oIE)

EndFunc

Func _SelectWorld($sWorld)
$oWorlds = _IELinkGetCollection($oIE)
For $oWorld In $oWorlds
$sWorldText = _IEPropertyGet($oWorld, "innerText")
If StringInStr($sWorldText, $sWorld) Then
_IEAction($oWorld, "click")
Return 0
EndIf
Next
Return 1
EndFunc

Но вот эта часть

$oTable = _IETableGetCollection($oIE, 0)
$aTableData = _IETableWriteToArray($oTable)

возвращает ошибку

--> IE.au3 V2.4-0 Warning from function _IETableGetCollection, $_IEStatus_NoMatch
--> IE.au3 V2.4-0 Error from function _IETableWriteToArray, $_IEStatus_InvalidDataType

Хотя на других сайтах работает изумительно




© OSzone.net 2001-2012