https://www.azoogleads.com/corp/apply2.php?i= 页面上有iframe,如何直接给这个页面的First Name 赋值

解决方案 »

  1.   

    …… 楼上的怎么不找我呢,我兴许500就给你弄了,呵呵Option Explicit
    Private Sub Form_Load()
        WebBrowser1.Navigate2 "https://www.azoogleads.com/corp/apply2.php?i="
    End Sub
    Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
        '"dataindex_first_name"
        If LCase(URL) = "https://apply2.azoogleads.com/" Then
            
            Dim oDoc As HTMLDocument
            Set oDoc = pDisp.Document
            
            SetIFrameTextValue oDoc, "dataindex_first_name", "Jonathan"
            SetIFrameTextValue oDoc, "dataindex_last_name", "Chen"
            SetIFrameTextValue oDoc, "dataindex_email", "[email protected]"
            SetIFrameTextValue oDoc, "dataindex_email_verify", "[email protected]"
        End If
        
    End SubPrivate Sub SetIFrameTextValue(oDoc As HTMLDocument, ByVal sTargetInputID As String, ByVal sValue As String)
        Dim oInputText As HTMLInputTextElement    Set oInputText = oDoc.getElementById(sTargetInputID)
        
        oInputText.Value = sValue
    End Sub
      

  2.   

    如果是在这个WebBrowser1_DocumentComplete事件里的话,我就不用找人做了,
    是在网页已经打开的情况下,比如已经在IE里面打开了这个网页,再用软件去操作
      

  3.   


    呵呵,我以前在论坛里就发过类似代码了,好像名字叫VBWebbrowserHunter啥的,专门就是抓其他ie内核浏览器窗口中ie对象的