Help me scrape some tables in VBA

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pringles
    SBR Rookie
    • 11-26-12
    • 41

    #1
    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.
  • a4u2fear
    SBR Hall of Famer
    • 01-29-10
    • 8147

    #2
    I've created a few threads on this, do some searching in this subforum
    Comment
    • mikmak
      SBR Rookie
      • 05-03-13
      • 29

      #3
      Comment
      • zlaroc
        SBR High Roller
        • 11-10-14
        • 125

        #4
        all good
        Comment
        SBR Contests
        Collapse
        Top-Rated US Sportsbooks
        Collapse
        Working...