Metodo utilizzato MsXml
allego lo spezzone di macro incriminato .
- Codice: Seleziona tutto
Set Html = CreateObject("htmlfile")
With CreateObject("WINHTTP.WinHTTPRequest.5.1")
For N = 2 To uR
MyIsin =cells(N,1) ' qui elenco isin
For i = 2 To 14
dati = Array(0, 0, 14, 28, 1, 3, 16, 17, 18, 19, 23, 24, 25, 26, 27)
If MyIsin <> "" Then
.Open "GET", "https://www.borsaitaliana.it/borsa/obbligazioni/eurotlx/scheda/" & Cells(N, 1) & ".html?lang=it", False ' tlx
.send
Html.body.innerHTML = .responseText
Application.Wait Now + TimeValue("00:00:01") 'pausa di 1 secondi
Cells(N, i) = Html.getElementsByClassName("t-text -right")(dati(i)).innerText
Ws1.Range("O" & N) = "T"
Else
.Open "GET", "https://www.borsaitaliana.it/borsa/obbligazioni/mot/euro-obbligazioni/scheda/" & Cells(N, 1) & ".html?lang=it", False ' Mot
.send
Html.body.innerHTML = .responseText
Application.Wait Now + TimeValue("00:00:01") 'pausa di 1 secondi
On Error GoTo salto
Cells(N, i) = Html.getElementsByClassName("t-text -right")(dati(i)).innerText
On Error GoTo 0
Ws1.Range("O" & N) = "M"
End If
Next i