使用 Internet Explorer vba 提交时我的用户名和密码丢失
my username and password is missing when submit it using vba for internet explorer
在此网站提交时我的用户名和密码丢失:https://play.playup.com/
这个 link 地址存储在单元格名称 E4 之一中,谁能帮我解决这个问题?请在您的编辑器中检查此代码以便更好地理解...
用户名:ajmsanvesh143@gmail.com
密码:ajms6237
代码:
Sub clicksignupurl()
Dim ie As Object
Set ie = CreateObject("internetexplorer.application")
ie.Visible = True
url_name = Sheet1.Range("E4")
If url_name = "" Then Exit Sub
ie.navigate url_name
Do
DoEvents
Loop Until ie.readyState = 4
Set allhyperlinks = ie.document.getElementsByTagName("span")
For Each hyper_link In allhyperlinks
If hyper_link.innertext = "Sign In" Then
hyper_link.Click
Exit For
End If
Next
Set mailid = ie.document.getelementbyid("username")
mailid.Value = "xxxxxxxxx"
Set passid = ie.document.getelementbyid("password")
passid.Value = "xxxxxxx"
Set allhyper = ie.document.getElementsByTagName("button")
For Each hyper_link In allhyper
If hyper_link.innertext = "Sign in" Then
hyper_link.Click
Exit For
End If
Next
End Sub
点击第一个超链接后,您无需等待加载新页面。在 Next.
之后添加这一行
...
Next
do while ie.busy or ie.readystate <> 4: DoEvents: loop 'need this!
Set mailid = ie.document.getelementbyid("username")
...
在此网站提交时我的用户名和密码丢失:https://play.playup.com/ 这个 link 地址存储在单元格名称 E4 之一中,谁能帮我解决这个问题?请在您的编辑器中检查此代码以便更好地理解... 用户名:ajmsanvesh143@gmail.com 密码:ajms6237 代码:
Sub clicksignupurl()
Dim ie As Object
Set ie = CreateObject("internetexplorer.application")
ie.Visible = True
url_name = Sheet1.Range("E4")
If url_name = "" Then Exit Sub
ie.navigate url_name
Do
DoEvents
Loop Until ie.readyState = 4
Set allhyperlinks = ie.document.getElementsByTagName("span")
For Each hyper_link In allhyperlinks
If hyper_link.innertext = "Sign In" Then
hyper_link.Click
Exit For
End If
Next
Set mailid = ie.document.getelementbyid("username")
mailid.Value = "xxxxxxxxx"
Set passid = ie.document.getelementbyid("password")
passid.Value = "xxxxxxx"
Set allhyper = ie.document.getElementsByTagName("button")
For Each hyper_link In allhyper
If hyper_link.innertext = "Sign in" Then
hyper_link.Click
Exit For
End If
Next
End Sub
点击第一个超链接后,您无需等待加载新页面。在 Next.
之后添加这一行...
Next
do while ie.busy or ie.readystate <> 4: DoEvents: loop 'need this!
Set mailid = ie.document.getelementbyid("username")
...