NiftyTrader
New Member
- Joined
- Jul 31, 2015
- Messages
- 15
Hello,
I need help trying to get the 1st line of the following 10-day forecast. Here is my code to get the forecast for Miami, FL on Weather.com. I am not able to get the current date or the first date in the summary. Please help. Thanks and take care.
Sub MiamiWeather()
Dim ieObj As InternetExplorer
Dim htmlEle As IHTMLElement
Dim i As Integer
i = 1
Set ieObj = New InternetExplorer
ieObj.Visible = False
ieObj.navigate "Miami, FL 10-Day Weather Forecast - The Weather Channel | Weather.com"
Application.Wait Now + TimeValue("00:00:05")
For Each htmlEle In ieObj.document.getElementsByClassName("_350ZO")(0).getElementsByTagName("summary")
With ActiveSheet
.Range("A" & i).Value = htmlEle.Children(0).textContent
End With
i = i + 1
Next htmlEle
End Sub
I need help trying to get the 1st line of the following 10-day forecast. Here is my code to get the forecast for Miami, FL on Weather.com. I am not able to get the current date or the first date in the summary. Please help. Thanks and take care.
Sub MiamiWeather()
Dim ieObj As InternetExplorer
Dim htmlEle As IHTMLElement
Dim i As Integer
i = 1
Set ieObj = New InternetExplorer
ieObj.Visible = False
ieObj.navigate "Miami, FL 10-Day Weather Forecast - The Weather Channel | Weather.com"
Application.Wait Now + TimeValue("00:00:05")
For Each htmlEle In ieObj.document.getElementsByClassName("_350ZO")(0).getElementsByTagName("summary")
With ActiveSheet
.Range("A" & i).Value = htmlEle.Children(0).textContent
End With
i = i + 1
Next htmlEle
End Sub