Hello,
I am trying to automate Internet Explorer. I would like to populate a text box on a form and automatically click submit, then return a value that the website gives to Excel. I can not populate the text box and tried several things. I went on to trying to click the button too, but I cant even get that to happen.
I have a sheet with two columns as follows:
In B2 I have a formula that I created(below) that is in a Module which loads IE and populates the page. Then I want to take the value of the domain name and place it into the input text box on the form, next I want to submit and wait for the value to come back.
Here is what I have tried:
Can anyone give me some tips as to why this isnt working?
Thanks!
Anthony
I am trying to automate Internet Explorer. I would like to populate a text box on a form and automatically click submit, then return a value that the website gives to Excel. I can not populate the text box and tried several things. I went on to trying to click the button too, but I cant even get that to happen.
I have a sheet with two columns as follows:
In B2 I have a formula that I created(below) that is in a Module which loads IE and populates the page. Then I want to take the value of the domain name and place it into the input text box on the form, next I want to submit and wait for the value to come back.
Here is what I have tried:
Code:
Function getGDValue(strDomainName As String) As Currency
Dim IE As New InternetExplorer
Dim doc As HTMLDocument
Dim allButtons As Object
Dim i As Integer
IE.Visible = True
'GO TO THE GODADDY VALUATION PAGE
IE.Navigate "https://www.godaddy.com/domain-value-appraisal"
'WAIT FOR THE PAGE TO LOAD
Do
DoEvents
Loop Until IE.LocationName = "Free Domain Value and Appraisal Tool | What is your domain worth? - - GoDaddy"
Set doc = IE.document
'PLACE THE DOMAIN NAME TO BE CHECKED INTO THE TEXT BOX
IE.document.getElementsByTagName("domainToCheck") = strDomainName
'FIND THE BUTTON TO SUBMIT
Set allButtons = IE.document.getElementsByTagName("button")
Do While i < allButtons.Length
If allButtons(i).Type = "submit" And allButtons(i).Value = "btn btn-primary submit" Then
allButtons(i).Click
Exit Do
End If
i = i + 1
Loop
'GET THE ESTIMATED VALUE AND RETURN IT FROM THE CALL
getGDValue = doc.getElementsByTagName("dpp-price price")(0).innerText
'CLOSE IE AND CLEAN UP OBJECT
IE.Quit
Set IE = Nothing
End Function
Can anyone give me some tips as to why this isnt working?
Thanks!
Anthony