Good evening.
I would like to know how I can update the page with the date that I reported by VBA. I put the date but the page does not change. Since you do not have a button, I do not know what to do.
Sub Links()
Dim ie As Object
Dim tabela As Object
Dim Liga, DataHora As String
Dim Home, Away As String
Dim Link, data As String
Dim ResultadoFinal As String
Dim Posiz1, Posiz2 As Long
Dim linha
data = ThisWorkbook.Sheets("Plan1").Range("AD2")
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True
URL = "https://betsapi.com/cs/basketball/"
ie.Navigate URL
State = 0
Do Until State = 4
DoEvents
State = ie.ReadyState
Loop
'até consigo mudar a data, mas ao mudar a data a pagina deveria se ajustar a essa data
'(como ocorre ao clicar de forma manual), mas isso não ocorre ao preencher pelo vba.
ie.Document.forms.Item(1).Item(0).Value = Sheets("Plan1").Range("AD2") 'conte uma data. Ex: 2018-05-06
Text1 = ie.Document.Body.innerHTML
Text1 = Replace(Text1, "a href=/r/", "CJOS QUER ")
'Coleta a parte importante dos links com base no meu marcador
Posiz1 = 1
i = 1
Do
On Error GoTo sai
Posiz1 = InStr(Posiz1, Text1, "CJOS QUER ")
Posiz1 = InStr(Posiz1, Text1, "CJOS QUER ") + 10
Posiz2 = InStr(Posiz1, Text1, ">")
Link = Trim(Mid(Text1, Posiz1, Posiz2 - Posiz1))
c = InStr(1, Link, "/")
Range("A" & i) = Left(Link, c - 1)
Range("H" & i) = "https://betsapi.com/rs/bet365/" & Link
Posiz1 = Posiz2 + 1
i = i + 1
Loop
sai:
ie.Quit
Set tabela = Nothing
Set ie = Nothing
End Sub