Как получить значение из формы html с помощью скрипта visual basi c - PullRequest
0 голосов
/ 22 января 2020

Я пытаюсь получить значение ошибки из возвращенной веб-формы.

Этот код работал, но что-то изменилось. Теперь я получаю сообщение об ошибке «Объект не поддерживает это свойство или метод».

enter code here
'Get error message from returned web page
 Set daTable = IE4.Document.getElementById("errorMessages")
 Do While IE4.ReadyState <> 4 Or IE4.Busy
  WScript.Sleep 10
 Loop

 Do While IE4.Document.ReadyState <> "complete"
   WScript.Sleep 10 
 Loop
 strOut = ""
 For i = 0 To daTable.rows.length - 1
   For j = 0 To daTable.rows.item(i).cells.length - 1
    strOut = strOut & daTable.rows.item(i).cells.item(j).innerText
   Next
 Next
'Check if error message is Inventory is not available.
  Message4="Late"
  If strOut <> "Inventory is not available. Site cannot be booked." Then
  Message4="Early"
  End If

Я также пытался

enter code here
   Set daTable = IE5.Document.getElementById("msg1")

, но это не работает.

Вот форма HTML.

 <div id="errorMessages">
 <div class="msg error" id="msg1">
 Inventory is not available. Site cannot be booked.
  </div>
 </div>

Есть идеи, что я делаю не так?

...