I am new to HTML and I am trying to automate web scraping using VBA.
However, I am stuck.
I need to be able to set the current date to "20190528" but not sure how to access the HTML code i.e. I tried doing something like this in vba but I am not sure HTMLDoc.getElementById("ReportViewerControl_ctl04_ctl03_ddValue") is correct and if it is, do not know what to do after that to set the date to 20190528
Option Explicit
Sub BrowseToSite()
Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
Dim HTMLDoc As MSHTML.HTMLDocument
Dim HTMLInput As MSHTML.IHTMLElement
IE.Visible = True
IE.navigate url
Do While IE.ReadyState <> 4
Loop
Set HTMLDoc = IE.document
Set HTMLInput = HTMLDoc.getElementById("ReportViewerControl_ctl04_ctl03_ddValue")
End Sub
However, I am stuck.
I need to be able to set the current date to "20190528" but not sure how to access the HTML code i.e. I tried doing something like this in vba but I am not sure HTMLDoc.getElementById("ReportViewerControl_ctl04_ctl03_ddValue") is correct and if it is, do not know what to do after that to set the date to 20190528
Option Explicit
Sub BrowseToSite()
Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
Dim HTMLDoc As MSHTML.HTMLDocument
Dim HTMLInput As MSHTML.IHTMLElement
IE.Visible = True
IE.navigate url
Do While IE.ReadyState <> 4
Loop
Set HTMLDoc = IE.document
Set HTMLInput = HTMLDoc.getElementById("ReportViewerControl_ctl04_ctl03_ddValue")
End Sub