Results 1 to 6 of 6

Thread: Automating entry of UserID / Password to website from VB

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 1999
    Location
    1875 Oak Tree Drive, LA 90041, USA
    Posts
    3

    Post

    Hi:

    I'm trying to automate the daily downloading of data from a website that I conventionally get into by entering a userID then a password then hitting Enter (or clicking on the button).

    I can't figure how to automate the entry of the userID into the field on the starting page, then the password, then hitting enter.

    Can you help me figure this out, please? Once I'm in there, I want to pull the page down into my PC and extract certain data to add into a database in my PC.

    Thx - Geoffrey Daniel

  2. #2
    Addicted Member
    Join Date
    Jan 1999
    Posts
    173

    Post

    Is the page an ASP page or an HTML page posting to a CGI script?

    ------------------
    "To the glory of God!"

  3. #3
    Addicted Member
    Join Date
    Jan 1999
    Posts
    173

    Post

    OK. ASP stands for Active Server Pages (find more at www.activeserverpages.com) and CGI stands for Common Gateway Interface. When writing a CGI script people mainly use a language called Perl (www.perl.com)

    Anyway, it looks to me like you can use VB to execute the url that you gave me. I would suggest using the Inet control (see www.vbsquare.com/internet/):

    b() = Inet1.OpenURL("https://www.retirelink.com/wconnect/wc.dll?DataServer~Checklogin~LOGIN~home.asp", icByteArray)

    This sets the byte variable b to the output content of the url. To get readable results from b, do this:

    For intCount = 0 To UBound(b)-1
    strData = strData & Chr(b(intCount))
    next

    strData will now contain the output that you would see in your browser (well, it gives the source code of the output page)

    ------------------
    "To the glory of God!"

  4. #4

    Thread Starter
    New Member
    Join Date
    Dec 1999
    Location
    1875 Oak Tree Drive, LA 90041, USA
    Posts
    3

    Post

    Yes, and thanks, but how do I get through the UserName and Password steps first?

  5. #5
    Addicted Member
    Join Date
    Jan 1999
    Posts
    173

    Post

    From your description it would appear that it is an HTML form (although I can't get through with the link you gave me). The problem with HTML forms is that they submit to CGI scripts which reads variables that were passed from the HTML page in the form of the values you inputted to the text boxes etc.

    What you need to do first is to goto the login page in your browser, view the source and look at the <input> tags. Make a note of their names, and the use the following to post data to the script:

    b() = Inet1.OpenUrl("http://www.myurl.com/myscript.dll?userid=myuserid&password=mypassword", icByteArray)

    Now use the code I gave earlier to get the response from the web site.

    ------------------
    "To the glory of God!"

  6. #6

    Thread Starter
    New Member
    Join Date
    Dec 1999
    Location
    1875 Oak Tree Drive, LA 90041, USA
    Posts
    3

    Post

    I don't know what as ASP is, but I believe it's an HTML page. As for CGI, I don't know how I would know what technology the site is using for this particular page. In case it helps - perhaps you could take a look at it, it's "https://www.retirelink.com/wconnect/wc.dll?DataServer~Checklogin~LOGIN~home.asp"

    Wow - must be an asp (whatever that is!).

    - Geoffrey

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width