Vorrei importare da diversi bookmaker le quote di diversi mercati
Premetto che non so neanche da dove partire
Grazie 1000 a chi vorrà indirizzarmi e supportarmi e cmq complimenti a tutti del forum.
Moderatori: Anthony47, Flash30005
Call GetTabbbSub(Range("Z1").Value) ' "Chiama" la GetTabbbSub Call GetTabbbSub("https://www.bet365.it/#/HO/") ' "Chiama" la GetTabbbSub
Bat66 ha scritto:Il richiamo adesso mi è chiaro, grazie, appena rientro provo - adesso resta da capire come trovare le tabelle da importare dalla pagina del sito.
Help!!!
Call GetTabbbSub("http://finanza-mercati.ilsole24ore.com/azioni/borsa-italiana/listino-completo/listino-completo.php?ID=2_2_11&livello1ID=202")
Sub Call1()
Sheets("Foglio3").Select '<<< Il foglio su cui si fara' l'importazione
Range("A:X").ClearContents 'NB: Il fofglio SARA' AZZERATO senza preavviso
Range("A:X").NumberFormat = "@" 'Colonne in formato Testo
Call GetTabbbSub(Range("Z1").Value) ' "Chiama" la GetTabbbSub
Range("A:X").WrapText = False
End Sub
Sub GetTabbbSub(ByVal myURL As String)
'Va Chiamata passandogli l'URL da leggere
Set IE = CreateObject("InternetExplorer.Application")
'
With IE
.navigate myURL
.Visible = True
'Stop 'Vedi TESTO
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
'Scrive le tabelle SUL FOGLIO ATTIVO
Set myColl = IE.document.getElementsByTagName("TABLE")
For Each myItm In myColl
Cells(I + 1, 1) = "Table# " & ti + 1
ti = ti + 1: I = I + 1
For Each trtr In myItm.Rows
For Each tDtD In trtr.Cells
Cells(I + 1, j + 1) = tDtD.innerText
Cells(I + 1, j + 1).HorizontalAlignment = xlLeft
'Legge hyperlink:
If InStr(1, tDtD.innerHTML, "href", vbTextCompare) > 0 Then
DoEvents: DoEvents
ActiveSheet.Hyperlinks.Add anchor:=Cells(I + 1, j + 1), _
Address:=tDtD.getElementsByTagName("a")(0).href
End If
If j > 0 And Len(Cells(I + 1, j + 1)) > 2 Then cz = 1
j = j + 1
Next tDtD
'Allinea al centro se e' una Intestazione:
If trtr.classname = "js-tournament" Then
Cells(I + 1, 1).HorizontalAlignment = xlCenter
End If
I = I + 1: j = 0
DoEvents
Next trtr
I = I + 1
Next myItm
'
'Chiusura IE
IE.Quit
Set IE = Nothing
End SubHai fatto correttamente quel che dovevi fare...Ciao Anthony, adesso ti farò ridere, ho incollato l'intero codice in un modulo macroper cercare di vedere il comportamento:
Poi ho inserito al posto di z1 quel sito che ti ho scritto nel post precedente, sempre per capire come e cosa scaricava ma niente
Torna a Applicazioni Office Windows
| Excel apre solo una schermata bianca Autore: jameswilson |
Forum: Applicazioni Office Windows Risposte: 1 |
| Inserire dati filtrati da 2 file ad un terzo file Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 14 |
| Inserire add.in nella barra di avvio veloce in excel 2003 Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 4 |
| Excel: problema con date se devo unirle a testi Autore: valle1975 |
Forum: Applicazioni Office Windows Risposte: 7 |
Visitano il forum: Nessuno e 20 ospiti