我有一张excel表包含我想在特定网页上搜索并将结果输入单元格的名称列表。我使用下面的代码打开网页,但我找不到正确的代码来点击登录按钮“我写了登录按钮的源代码”
我的代码打开网页并插入用户名和密码如下
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
我的问题分为两部分:
提交按钮的源代码是
<button class="button" type="submit"><span class="bg-left"><span class="bg-right">Login</span></span></button>
登录
<span class="bg-right">Login</span>
感谢您的支持和感谢,并提供示例代码。