Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 67441

How to populate a web page form using VB6

$
0
0

What I would like to do is populating a login form web page using VB6. I use the following code:

Dim IE As InternetExplorer   
Dim HTMLDoc As HTMLDocument  
Dim COL As MSHTML.IHTMLElementCollection
Dim ELEMENT As MSHTML.HTMLInputElement

Set IE = New InternetExplorer

IE.Visible = True
IE.Navigate "https://app.listonic.com/lists"

Do
    DoEvents
Loop Until IE.ReadyState = READYSTATE_COMPLETE

Set HTMLDoc = IE.Document
Set COL = HTMLDoc.getElementsByTagName("a")

For Each ELEMENT In COL
    If ELEMENT.innerHTML = "Sign In" Then ELEMENT.Click
Next ELEMENT

Do
    DoEvents
Loop Until IE.ReadyState = READYSTATE_COMPLETE

Set COL = HTMLDoc.getElementsByTagName("input")

For Each ELEMENT In COL
    Debug.Print "Inner HTML - "& ELEMENT.innerHTML
    Debug.Print "Outer HTML - "& ELEMENT.outerHTML
    Debug.Print ELEMENT.getAttribute("name")

    If ELEMENT.getAttribute("name") = "Email" Then
        Call ELEMENT.setAttribute("Value", "yourid@server.com")
    End If
    'If ELEMENT.innerHTML = "Sign In" Then ELEMENT.Click
Next ELEMENT

The problem is that this code:

Call ELEMENT.setAttribute("Value", "yourid@server.com")

does not work. I mean by this, I cannot see "yourid@server.com" address on the web page in Email field.

What do I do wrong?


Viewing all articles
Browse latest Browse all 67441

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>