Я самостоятельно преодолел проблему с подключением, используя WinHTTP
(это была ошибка с Debug.Print
метода текста ответа).
Так что я должен взять много значений из формы (более20), а затем создайте строку и передайте ее http://exampletry.it/visualizzaelenco.do
для генерации файла PDF.
Это образец кода формы.
<BODY>
<form name="trattamentoForm" method="post" action="/ecportal/trattamento_dettaglio.do">
<input type="hidden" name="service" value="">
<input type="hidden" name="ufficioLoggato" value="">
<input type="hidden" name="uff_comp" value="DZT">
<input type="hidden" name="profiloUtente" value="U">
<input type="hidden" name="tipoModelloRicerca.codice" value="V">
<input type="hidden" name="tipoModelloRicerca.descrizioneEstesa" value="V - MODELLO V">
<input type="hidden" name="partRicerca" value="">
<input type="hidden" name="annoRicerca" value="">
<input type="hidden" name="codiceRicerca" value="123456789">
<input type="hidden" name="dataPresRicerca" value="">
<input type="hidden" name="numProtRicerca" value="">
<input type="hidden" name="concessionarioRicerca.codice" value="">
......
Так как я могу получитьимя и значение без использования тэга?Я использую WinHTTP и не хочу использовать IE или другой веб-браузер.(Я просто могу сделать это, используя .click
и VBA и IE)
ДОБАВЛЕННЫЙ КОД
oHtml.body.innerHTML = http.responseText
If http.Status = 200 Then
Set OSTREAM = CreateObject("ADODB.Stream")
OSTREAM.Open
OSTREAM.Type = 1
OSTREAM.Write http.responseBody
File1 = "E:\test.html"
OSTREAM.SaveToFile File1, 2
OSTREAM.Close
End If
Dim html As HTMLDocument
Set html = GetHTMLFileContent("E:\test.html")
Dim list As Object, i As Long
Set list = html.querySelectorAll("trattamentoForm")
For i = 0 To list.length - 1
Debug.Print "Name: " & list.Item(i).Name, "Value: " & list.Item(i).Value
Next