I have an excel sheet contains list of names which I want to search on specific web page and get their results into cell . I used the below code to open webpage but I can not figure out the correct code to click on log on button "I wrote the source code for the logon button"
my code to open webpage and insert user name and password is as below
Sub Button173_Click()
' open IE, navigate to the desired page and loop until fully loaded
Set ie = CreateObject("InternetExplorer.Application")
my_url = "https://www.checkname.com/frontend/login"
With ie
.Visible = True
.Navigate my_url
.Top = 50
.Left = 530
.Height = 400
.Width = 400
Do Until Not ie.Busy And ie.readyState = 4
DoEvents
Loop
End With
'Input the userid and password
ie.Document.getElementById("signOnName").Value = "username"
ie.Document.getElementById("password").Value = "password"
'Click the "Search" button
ie.Document.getElementById("sign-in").Click
Do Until Not ie.Busy And ie.readyState = 4
DoEvents
Loop
End Sub
my question is divided into two part :
- how to click on button in a web page ?
source code of submit button is
<button class="button" type="submit"><span class="bg-left"><span class="bg-right">Login</span></span></button>
Login
<span class="bg-right">Login</span>
- how to past a name in a cell A2 for example into text box in the opened web page and press search then get the link of search result and past it into cell B2?
appreciate your support and thanks in advance and would be great to provide sample code .