1
Good night.
I wonder how I can update the page with the date I informed by VBA. I put the date but the page does not change. Since there’s no button, I don’t 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
Declaring the variable
Dim formData As MSHTML.HTMLFormElement
, defining howSet formData = ie.document.getElementById("datepicker").form
and sending the formformData.submit
it is possible to send. However it does not send the date changed with the value.Value
, but today’s date. I used Fireevent "Onchange" andkeybd_event VK_RETURN, 0&, 0&, 0&
without success. Let’s wait to see if anyone has the answer and I’ll ask on the Soen to see if I can get the answer because I was curious.– danieltakeshi