1

Тема: AHK: InternetExplorer и DOM HTML

Pwb := ComObjCreate("InternetExplorer.Application") ;create a IE instance
Pwb.Visible := True
Pwb.Navigate("http://www.svyaznoy.ru/catalog/phone/224")

while, Pwb.ReadyState != 4
  Sleep, 10

for vallie in Pwb.Document.body.all   ; !!!СДЕСЬ ОШИБКА!!!
{
   if (vallie.ClassName = "h1" & vallie.InnerText = "Производители")
   {
      for vallie2 in vallie.firstChild
         MsgBox, % vallie2.firstChild.innerText
   }
}
return

При выполнении кода цикла "for" вылезает ошибка:
Error: 0x80020006
Specifically:_NewEnum

Плиз help me. как сделать правильно ?

2 (изменено: chippp, 2012-08-27 21:17:51)

Re: AHK: InternetExplorer и DOM HTML

Сам отвечу на свой вопрос.

allelements := Pwb.Document.body.all

Loop % allelements.Length
{
If ((allelements[A_Index-1].ClassName = "h1") and (allelements[A_Index-1].InnerText = "Производители"))
    {
    .....CODE.....
    }
}