1. #1
    pringles
    pringles's Avatar Become A Pro!
    Join Date: 11-26-12
    Posts: 41
    Betpoints: 186

    Help me scrape some tables in VBA

    Hi, i would like to scrape http://www.soccerstats.com/ , many leagues.
    So i would need to write a code that would scrape ... lets say even all the leagues and put every league table into different sheet in excel.
    Unfortunately I have 0 experience in programming so I have many questions which hopefully will lead to myself and others learning vba scraping.

    Trying to search something on the internet, i came up with this ...
    Let Chilean league be our sample :

    Code:
    Public Sub MainCode()
    
    
    Dim appIE As Object
    Set appIE = CreateObject("internetexplorer.application")
    
    
    With appIE
        .Navigate "http://www.soccerstats.com/widetable.asp?league=chile"
        .Visible = False
    End With
    
    
    Do While appIE.Busy
        DoEvents
    Loop
    
    
    Set allRowOfData = appIE.document.getElementById("?How to find the ID for the whole table in chrome page source?")
    
    
    'What should i put here to get the whole table?
    Dim myValue As String: myValue = allRowOfData.Cells(0).innerHTML
    
    
    appIE.Quit
    Set appIE = Nothing
    
    
    Range("A1").Value = myValue
    
    
    End Sub
    I couldnt find the name for the whole table using page source : (
    Also im guessing there is quite a bit missing, but we have a start.

  2. #2
    a4u2fear
    TEASE IT
    a4u2fear's Avatar SBR PRO
    Join Date: 01-29-10
    Posts: 8,147
    Betpoints: 35459

    I've created a few threads on this, do some searching in this subforum

  3. #3

  4. #4
    zlaroc
    zlaroc's Avatar Become A Pro!
    Join Date: 11-10-14
    Posts: 125

    all good

Top