使用vb.net自动填充Web表单

时间:2013-10-03 06:35:13

标签: vb.net winforms webbrowser-control

Public Class Form1
    Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        WebBrowser1.Navigate("ireservea.apple.com/HK/zh_HK/reserve/iPhone", Nothing, Nothing, "User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1468.0 Safari/537.36")
    End Sub

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        WebBrowser1.Document.GetElementById("reservationCode").SetAttribute("Value", txtReservationCode.Text)
        WebBrowser1.Document.GetElementById("phoneNumber").SetAttribute("Value", "85212345678")
        WebBrowser1.Document.GetElementById("captchaAnswer").SetAttribute("Value", txtVerifyText.Text)
        WebBrowser1.Document.GetElementById("continue").InvokeMember("click")
    End Sub
End Class

无论如何,在我提交表格之后。 它说浏览器不能支持并打电话给我下载Safari 怎么解决?它与用户代理有关吗?

0 个答案:

没有答案