TheEnergyMan
New Member
- Joined
- Mar 12, 2019
- Messages
- 12
I cant seem to work out how to input text into the text field,
when inspecting the element in google it gives me:
<input> class="gwt-Textbox" type="text" size="35">
current code im using is:
im htmldoc As HTMLDocument
Dim IE As InternetExplorer
Dim myhtml_element As IHTMLElement
Dim myurl As String
myurl = "https://www.degreedays.net/"
Set IE = New InternetExplorer
With IE
.Silent = True
.navigate myurl
.Visible = True
End With
Do
DoEvents
Loop Until IE.readyState = 4
Set htmldoc = IE.document
'This is the area I am having issues with'''
For Each ele In IE.document.getElementsByTagName("Input")
If ele.Type = "text" Then ele.Value = "EGPF"
Next ele
'this clicks generate degree days
For Each myhtml_element In htmldoc.getElementsByClassName("submitButton")
If myhtml_element.Type = "button" Then myhtml_element.Click:
Next
Do
DoEvents
Loop Until IE.readyState = READYSTATE_COMPLETE
End Sub
when inspecting the element in google it gives me:
<input> class="gwt-Textbox" type="text" size="35">
current code im using is:
im htmldoc As HTMLDocument
Dim IE As InternetExplorer
Dim myhtml_element As IHTMLElement
Dim myurl As String
myurl = "https://www.degreedays.net/"
Set IE = New InternetExplorer
With IE
.Silent = True
.navigate myurl
.Visible = True
End With
Do
DoEvents
Loop Until IE.readyState = 4
Set htmldoc = IE.document
'This is the area I am having issues with'''
For Each ele In IE.document.getElementsByTagName("Input")
If ele.Type = "text" Then ele.Value = "EGPF"
Next ele
'this clicks generate degree days
For Each myhtml_element In htmldoc.getElementsByClassName("submitButton")
If myhtml_element.Type = "button" Then myhtml_element.Click:
Next
Do
DoEvents
Loop Until IE.readyState = READYSTATE_COMPLETE
End Sub
Last edited: