Codice intero (pronto per essere eseguito da una macro):
Sub DownloadBzwbk()
Dim appIE As Object ' InternetExplorer.Application
Dim sURL As String
Dim UserN As Object ' MSHTML.IHTMLElement
Dim PW As Object ' MSHTML.IHTMLElement
Dim PW2 As Object
Dim Testo As Object
Dim Element As Object ' HTMLButtonElement
Dim btnInput As Object ' MSHTML.HTMLInputElement
Dim ElementCol As Object ' MSHTML.IHTMLElementCollection
Dim Link As Object ' MSHTML.HTMLAnchorElement
Dim strCountBody As String
Dim lStartPos As Long
Dim lEndPos As Long
Dim TextIWant As String
Dim GetIE As Object
Set GetIE = CreateObject("internetexplorer.application")
Application.ScreenUpdating = False
Set appIE = GetIE
'On Error GoTo Messaggiodierrore
sURL = "https://ibiznes24.pl/bzwbk24biznes-client/login.html"
With appIE
.navigate sURL
'togli il commento alla linea sotto per vedere il web
.Visible = True
End With
Do While appIE.Busy
Loop
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 3
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
Set ElementCol = appIE.document.getElementsByTagName("input")
For Each btnInput In ElementCol
If btnInput.ID = "x-auto-2-input" Then
btnInput.Value = "11111111"
Exit For
End If
Next btnInput
Do While appIE.Busy
Loop
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 3
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
Set ElementCol = appIE.document.getElementsByClassName("x-btn-text")
For Each btnInput In ElementCol
If btnInput.innerText = "Dalej" Then
btnInput.Click
Exit For
End If
Next btnInput
Do While appIE.Busy
Loop
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 2
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
Set ElementCol = appIE.document.getElementsByTagName("input")
For Each btnInput In ElementCol
If (btnInput.ID = "x-auto-13") And (btnInput.className = "enabled x-component") Then
btnInput.Value = "A"
Exit For
End If
Next btnInput
End Sub