Pagina precedente | 1 | Pagina successiva
Stampa | Notifica email    
Autore

Importazione dati dal sito Betdradar con formattazione completa

Ultimo Aggiornamento: 17/12/2017 18:27
Post: 12
Registrato il: 27/07/2017
Città: BARLETTA
Età: 62
Utente Junior
2016
OFFLINE
17/12/2017 12:18

Tramite questa macro seguente, riesco a importare dati dal sito in oggetto, senza formattazione. Poichè in colonna B vanno a finire dati che sul sito sono colegamenti ipertestuali come posso trasformare questa macro affinchè possa importare dati con formattazione completa? In questo modo ritroverei in colonna B i collegamenti ipertestuali. Grazie

Sub Macro1()

Application.Calculation = xlCalculationManual

myURL = "http://stats.betradar.com/s4/?clientid=5&language=it#2_1,3_17,22_1,5_41264,9_fixtures,231_full,23_1"

Set ie = CreateObject("InternetExplorer.Application")

With ie
.navigate myURL
.Visible = True
Do While .Busy: DoEvents: Loop
Do While .readyState <> 4: DoEvents: Loop
End With
'
myStart = Timer
Do
DoEvents
If Timer > myStart + 2 Or Timer < myStart Then Exit Do
Loop

I = 1
Worksheets("Foglio1").Activate
Range("A:G").Clear
Set mycoll = ie.document.getElementsByTagName("TABLE")
For Each myItm In mycoll
For Each trtr In myItm.Rows
For Each tdtd In trtr.Cells
Cells(I + 1, J + 1) = tdtd.innerText
J = J + 1
Next tdtd
I = I + 1: J = 0
Next trtr
I = I + 1
Next myItm

ie.Quit
Set ie = Nothing
Calculate

End Sub
Post: 616
Registrato il: 16/08/2015
Città: CORDENONS
Età: 67
Utente Senior
Excel 2016-32bit Win11
OFFLINE
17/12/2017 16:37

Quelli che tu chiami "collegamenti ipertestuali" nel sito altro non sono che "link" gestiti tramite Java ... cosa che non ha niente a che fare con i "collegamenti ipertestuali" di Excel.
Copia il link nel Blocco Note e lì si mostrerà in tutta la sua concretezza.

______________________________________________________________
C'è chi fa le COSE a CASO e chi fa CASO alle COSE (Ignoto)
Post: 12
Registrato il: 27/07/2017
Città: BARLETTA
Età: 62
Utente Junior
2016
OFFLINE
17/12/2017 18:27

Gent.mo Rollis13. Innanzitutto ti ringrazio per la risposta. Quello che volevo dirti, c'è la possibilità di importare questi link con la macro. Io ho provato con la query web
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://stats.betradar.com/s4/?clientid=5&language=it#2_1,3_17,22_1,5_41264,9_fixtures,231_full,23_1" _
, Destination:=Range("$A$1"))
.CommandType = 0
.Name = _
"?clientid=5&language=it#2_1,3_17,22_1,5_41264,9_fixtures,231_full,23_1"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingAll
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
ma mi esce il messaggio, nella cella dove avrei dovuto importare i dati, il messaggio:
JavaScript might have been turned off. Please check your browser settings in order to access and use this site.
Amministra Discussione: | Chiudi | Sposta | Cancella | Modifica | Notifica email Pagina precedente | 1 | Pagina successiva
Nuova Discussione
 | 
Rispondi
Cerca nel forum
Tag discussione
Discussioni Simili   [vedi tutte]
Feed | Forum | Bacheca | Album | Utenti | Cerca | Login | Registrati | Amministra
Tutti gli orari sono GMT+01:00. Adesso sono le 13:31. Versione: Stampabile | Mobile | Regolamento | Privacy
FreeForumZone [v.6.1] - Copyright © 2000-2024 FFZ srl - www.freeforumzone.com