Skip to main content

AccessTr.neT


makro ile excele veri almak

makro ile excele veri almak

#3
ÖRNEK ÇALIŞMA DOSYAM AŞAĞIDA. FAKAT HEP Dim IE As New InternetExplorer HATASI VERIYOR. BEN GOOGLE CHROME KULLANIYORUM AMA BUNUNLA DA İLGİLİ DEĞİL SANIRIM. İE DENDE AÇTIM OLMADI.
ADRESTE RENK ILE ISARETLI BOLUM ÖZEL DEGERLER. BU HER MAÇ ICIN DEGISIYOR. BUNU BEN BULABILIYORUM.
Sub Test()

Dim URL As String
Dim IE As New InternetExplorer
Dim HTMLdoc As HTMLDocument
Dim dictObj As Object: Set dictObj = CreateObject("Scripting.Dictionary")
Dim tRowID As String

URL = "http://www.flashscore.com/match/02yaghdh/#odds-comparison;ht-ft;full-time"

With IE
.Navigate URL
.Visible = True
Do Until .ReadyState = READYSTATE_COMPLETE: DoEvents: Loop
Set HTMLdoc = .Document
End With

With HTMLdoc
'Target the set of tables.
Set tblSet = .getElementById("fs-results")
'Index starts at 0. World Cup Playoffs is (0), World Cup is (1),
'Qualifiers is (2), etc... Targeting tbody right away, as there is
'only one (1) tbody tag per row anyway.
Set mTbl = tblSet.getElementsByTagName("tbody")(1)
Set tRows = mTbl.getElementsByTagName("tr")
With dictObj
'If if value is not yet in dictionary, store it.
For Each tRow In tRows
'Remove the first four (4) characters.
tRowID = Mid(tRow.getAttribute("id"), 5)
If Not .Exists(tRowID) Then
.Add tRowID, Empty
End If
Next tRow
End With
End With

'Print out each of the ID values.
For Each Key In dictObj
Debug.Print Key
Next Key

Set IE = Nothing

End Sub
Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da

Bu Konudaki Yorumlar
makro ile excele veri almak - Yazar: siyahhayis - 10/12/2015, 20:10
Cvp: makro ile excele veri almak - Yazar: atoz112 - 11/12/2015, 14:37
Cvp: makro ile excele veri almak - Yazar: siyahhayis - 11/12/2015, 20:54
Cvp: makro ile excele veri almak - Yazar: siyahhayis - 11/12/2015, 20:56
Cvp: makro ile excele veri almak - Yazar: atoz112 - 05/06/2016, 15:48
Task