Ho provato con le queryweb e "restituisce" solo alcuni dati che invece a video risultano presenti. Memore di altro post ho provato con la macro
- Codice: Seleziona tutto
Sub pipp()
myUrl = "http://www.progsport.com/icehockey/"
Set IE = CreateObject("InternetExplorer.Application")
With IE
.navigate myUrl
.Visible = True
Do While .Busy: DoEvents: Loop 'Attesa not busy
Do While .readyState <> 4: DoEvents: Loop 'Attesa documento
End With
'
myStart = Timer 'attesa addizionale
Do
DoEvents
If Timer > myStart + 1 Or Timer < myStart Then Exit Do
Loop
'Leggi le tabelle, su un nuovo foglio
Sheets("Foglio4").Select '<<< Vedi testo
Set myColl = IE.document.getElementsByTagName("TABLE")
If myColl.Length < 5 Then
MsgBox ("Numero anomalo di tabelle, abortito")
GoTo IEQuit
End If
With myColl(4)
For Each trtr In .Rows
For Each tdtd In trtr.Cells
Cells(i + 1, J + 1) = tdtd.innerText
Cells(i + 1, 1).Select
J = J + 1
Next tdtd
i = i + 1: J = 0
Next trtr
i = i + 2
'Next myItm
End With
Set myColl = IE.document.getElementsByTagName("TABLE")
If myColl.Length < 5 Then
MsgBox ("Numero anomalo di tabelle, abortito")
GoTo IEQuit
End If
With myColl(5)
For Each trtr In .Rows
For Each tdtd In trtr.Cells
Cells(i + 1, J + 1) = tdtd.innerText
Cells(i + 1, 1).Select
J = J + 1
Next tdtd
i = i + 1: J = 0
Next trtr
i = i + 2
'Next myItm
End With
Set myColl = IE.document.getElementsByTagName("TABLE")
If myColl.Length < 5 Then
MsgBox ("Numero anomalo di tabelle, abortito")
GoTo IEQuit
End If
With myColl(10)
For Each trtr In .Rows
For Each tdtd In trtr.Cells
Cells(i + 1, J + 1) = tdtd.innerText
Cells(i + 1, 1).Select
J = J + 1
Next tdtd
i = i + 1: J = 0
Next trtr
i = i + 2
'Next myItm
End With
'Next II
SendKeys "{F5}", True
SendKeys "{ENTER}", True
IEQuit:
'Chiusura IE
IE.Quit
Set IE = Nothing
SendKeys "{F5}", True
SendKeys "{ENTER}", True
End Sub
ma non importa niente.
Ho provato con
- Codice: Seleziona tutto
Sub Macro4()
Sheets("Foglio4").Select
myUrl = "http://www.progsport.com/icehockey/"
Set IE = CreateObject("InternetExplorer.Application")
With IE
.navigate myUrl
.Visible = True
Do While .Busy: DoEvents: Loop 'Attesa not busy
Do While .readyState <> 4: DoEvents: Loop 'Attesa documento
End With
'
myStart = Timer 'attesa addizionale
Do
DoEvents
If Timer > myStart + 1 Or Timer < myStart Then Exit Do
Loop
'Leggi le tabelle, su un nuovo foglio
Sheets("Foglio4").Select '<<< Vedi testo
Set myColl = IE.document.getElementsByTagName("TABLE")
If myColl.Length < 5 Then
MsgBox ("Numero anomalo di tabelle, abortito")
GoTo IEQuit
End If
With myColl(4)
For Each trtr In .Rows
For Each tdtd In trtr.Cells
Cells(i + 1, J + 1) = tdtd.innerText
Cells(i + 1, 1).Select
J = J + 1
Next tdtd
i = i + 1: J = 0
Next trtr
i = i + 2
'Next myItm
End With
Set myColl = IE.document.getElementsByTagName("TABLE")
If myColl.Length < 5 Then
MsgBox ("Numero anomalo di tabelle, abortito")
GoTo IEQuit
End If
With myColl(5)
For Each trtr In .Rows
For Each tdtd In trtr.Cells
Cells(i + 1, J + 1) = tdtd.innerText
Cells(i + 1, 1).Select
J = J + 1
Next tdtd
i = i + 1: J = 0
Next trtr
i = i + 2
'Next myItm
End With
Set myColl = IE.document.getElementsByTagName("TABLE")
If myColl.Length < 5 Then
MsgBox ("Numero anomalo di tabelle, abortito")
GoTo IEQuit
End If
With myColl(10)
For Each trtr In .Rows
For Each tdtd In trtr.Cells
Cells(i + 1, J + 1) = tdtd.innerText
Cells(i + 1, 1).Select
J = J + 1
Next tdtd
i = i + 1: J = 0
Next trtr
i = i + 2
'Next myItm
End With
'Next II
SendKeys "{F5}", True
SendKeys "{ENTER}", True
IEQuit:
'Chiusura IE
IE.Quit
Set IE = Nothing
SendKeys "{F5}", True
SendKeys "{ENTER}", True
End Sub
ma non importa i valori nascosti.
Ci sono altre soluzioni?
Grazie anticipatamente.