【发布时间】:2015-04-14 10:27:17
【问题描述】:
我有一个关于重定向网址的问题。我正在自动填写。填写表格后,我提交表格并单击按钮。之后,它重定向到一个新页面。我需要那个重定向网址。
举例
webBrowser1.Navigate("myurl.com")
For I As Integer = 0 To 500
If webBrowser1.ReadyState = WebBrowserReadyState.Complete Then Exit For
Threading.Thread.Sleep(1)
Application.DoEvents()
Next
Dim elementLogin = webBrowser1.Document.GetElementById("login_identifier")
If Not IsNothing(elementLogin) Then
webBrowser1.Document.GetElementById("login_identifier").SetAttribute("Value", "myemail")
End If
Dim elementPassword = webBrowser1.Document.GetElementById("login_password")
If Not IsNothing(elementLogin) Then
webBrowser1.Document.GetElementById("login_password").SetAttribute("Value", "mypassword")
End If
webBrowser1.Document.GetElementById("login_btn").Enabled = True
webBrowser1.Document.GetElementById("login_btn").InvokeMember("click")
点击按钮后我需要重定向的 url。因为它在单击登录按钮后重定向到新页面。如果可能的话,请帮我解决这个问题 谢谢
【问题讨论】:
标签: asp.net vb.net webforms webbrowser-control