dionysus_83
New Member
- Joined
- Feb 24, 2016
- Messages
- 30
Code:
[COLOR=#333333]Sub getdata()[/COLOR]<code style="margin: 0px; padding: 0px; font-style: inherit; font-weight: inherit; line-height: 12px;">
Dim ie As New InternetExplorer
ie.Visible = True
ie.navigate "https://app.scheduleonce.com/Home.aspx"
With ie
While .Busy Or .readyState <> READYSTATE_COMPLETE: DoEvents: Wend
End With
Dim doc As HTMLDocument
Set doc = ie.document
Set dfrom = doc.getElementById("TxtDateFrom")
dfrom.Value = "Dec 01, 2017"
Set dto = doc.getElementById("TxtDateTo")
dto.Value = "Jan 31, 2018"
Set btn = doc.getElementsByTagName("input")(12)
btn.Click
With ie
While .Busy Or .readyState <> READYSTATE_COMPLETE: DoEvents: Wend
End With
Dim mt As String
For IDn = 1 To 100
mt = doc.getElementById("rowID_" & IDn).innerText
Sheets(1).Range("a" & IDn) = mt
Next IDn </code>[COLOR=#333333]End Sub[/COLOR]
VBA open page and it does change dates to one I've set but doesn't apply data range to generate report. I've noticed later that DateFrom is readonly. How can I change DateFrom and DateTo with VBA and execute date change to generate report?
And here is troublesome HTML :
HTML:
<div id="datediv" style=""><div class="filderItems"><div class="homeFilters"><div class="boldText">From:<input id="TxtDateFrom" style="" class="calendertbs" *******="OpenDatePicker('CalDivFrom', 'TxtDateFrom'); blur(); return false;"readonly="readonly" type="text" value="" /><span *******="OpenDatePicker('CalDivFrom', 'TxtDateFrom'); return false;" style="cursor: pointer"><img id="CalDivFrom" src="//cdn.scheduleonce.com/images/calender_icon.jpg" alt="" /></span></div></div></div><div class="filderItems"><div class="homeFilters ml10"><div class="boldText">To:<input id="TxtDateTo" style="" class="calendertbs" *******="OpenDatePicker('CalDivTo', 'TxtDateTo'); blur(); return false;"readonly="readonly" type="text" value="" /><span *******="OpenDatePicker('CalDivTo', 'TxtDateTo'); return false;" style="cursor: pointer"><img id="CalDivTo" src="//cdn.scheduleonce.com/images/calender_icon.jpg" alt="" /></span></div></div></div><div class="filderItems filterBtn" style=""><input type="button" value="Go" class="btn" style="" *******="DateFilter();" /></div>
Last edited: