Pull (Scrape) College Football Scores

jlhoover3

Board Regular
Joined
Nov 9, 2015
Messages
60
Office Version
  1. 365
Platform
  1. Windows
Hello all,

I am trying to pull information (scrape) that will bring the teams and score to an excel sheet from each week. Below is code I have used from another user's thread that worked until Yahoo changed their website.
Code:
Sub GetResults()



Dim WeekNum As Variant
Dim html As HTMLDocument


WeekNum = Sheets("Setup").Range("f4").Value
Sheets("Setup").Range("H:I").ClearContents






Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual


Set IE = New InternetExplorer
IE.Visible = False
Application.StatusBar = "Getting Scores. Please Wait"
IE.Navigate WeekNum


Do While IE.Busy: DoEvents: Loop
Do While IE.ReadyState <> 4: DoEvents: Loop


Dim ele As Object


i = 1
j = 1
k = 1
l = 1


'For Each ele In IE.Document.getElementsByClassName("team winner ")
'    Sheets("Setup").Range("H" & i).Value = ele.innerText
'    i = i + 1
'Next
'
'For Each ele In IE.Document.getElementsByClassName("team  ")
'    Sheets("Setup").Range("I" & j).Value = ele.innerText
'    j = j + 1
'Next


For Each ele In IE.Document.getElementsByClassName("away ")
    Sheets("Setup").Range("H" & k).Value = ele.innerText
    k = k + 1
Next


For Each ele In IE.Document.getElementsByClassName("home ")
    Sheets("Setup").Range("I" & l).Value = ele.innerText
    l = l + 1
Next


Application.StatusBar = ""


'Sheets("Scrape").Range("A1").Select


IE.Quit


Application.ScreenUpdating = True


Application.Calculation = xlCalculationAutomatic
Cells.EntireColumn.AutoFit


Columns("E:I").Select
Selection.EntireColumn.Hidden = True




MsgBox "Done!"


'FindAndTerminate


End Sub
Sub FindAndTerminate(ByVal strProcName As String)
    Dim objWMIService, objProcess, colProcess
    Dim strComputer, strList
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" _
    & strComputer & "\root\cimv2")
    Set colProcess = objWMIService.ExecQuery _
    ("Select * from Win32_Process Where Name = '" & strProcName & "'")
    If colProcess.Count > 0 Then
        For Each objProcess In colProcess
            objProcess.Terminate
        Next objProcess
    End If
End Sub

However, this doesn't work now. The URL it was using at the time was
http://sports.yahoo.com/college-football/scoreboard/?week=8&conf=

Anybody have any ideas how to pull this information now, or maybe from another website. Any news is good news! I appreciate the time!!!!

<tbody>
</tbody>
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Still looking for a resolution on this. Worked on it a bit during the evening, and was able to pull teams, but not sure about the scores. Thanks to anybody that can help, much appreciated!
 
Upvote 0

Forum statistics

Threads
1,215,884
Messages
6,127,565
Members
449,385
Latest member
KMGLarson

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top