get and post method on web page (1 Viewer)

sal21

Registered User.
Local time
Today, 06:31
Joined
Apr 16, 2004
Messages
19
https://italia.indettaglio.it/ita/c...campania&regione_estesa=Campania&citta=Napoli

Based this link.

ho to select 80128 from Cap, and press on button Ricerca?

In effect the, after Ricerca the web retrieve a table with result, of cap 80128

My code, but not return result of table!

Public Sub test()

Dim myHTMLDoc As New HTMLDocument, Handle As Integer

With CreateObject("MSXML2.XMLHTTP")

.Open "GET", "https://italia.indettaglio.it/ita/c...campania&regione_estesa=Campania&citta=Napoli", False
.send

myHTMLDoc.body.innerHTML = .responseText

'Debug.Print .responseText

'<FORM ACTION="cap_citta_out.html" method="POST">
.Open "POST", "https://italia.indettaglio.it/ita/cap/cap_citta_out.html", False
.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"

.send "cap=80121"
myHTMLDoc.body.innerHTML = .responseText

Debug.Print .responseText

Handle = FreeFile
Close #Handle
Open "C:\TABULATI\CAP_80121.TXT" For Output As #Handle
Print #Handle, .responseText
Close #Handle

End With

End Sub
 

Users who are viewing this thread

Top Bottom