+ Reply to Thread
Results 1 to 2 of 2

Pulling Data From Password Protected Website Using VBA Macro

Hybrid View

  1. #1
    Registered User
    Join Date
    06-16-2016
    Location
    Austin
    MS-Off Ver
    10
    Posts
    2

    Pulling Data From Password Protected Website Using VBA Macro

    Hi all. I'm trying to access data from a password protected website. The first step is to log into the website which is what I'm struggling with. This is my first time ever using VBA so I scraped together some information online over the past hour and a half and put this together.

    Sub test()
    ' open IE, navigate to the desired page and loop until fully loaded
        Set ie = CreateObject("InternetExplorer.Application")
        my_url = "sample url"
    
        With ie
            .Visible = True
            .Navigate my_url
            .Top = 50
            .Left = 530
            .Height = 400
            .Width = 400
    
        Do Until Not ie.Busy And ie.ReadyState = 4
            DoEvents
        Loop
    
        End With
    
    
    ' Input the userid and password
        ie.Document.getElementById("#user").Value = "sampleusername"
        ie.Document.getElementById("#pwd").Value = "samplepassword"
    
    ' Click the "Search" button
        ie.Document.getElementById("#loginform").Click
    
        Do Until Not ie.Busy And ie.ReadyState = 4
            DoEvents
        Loop
     
    End Sub
    Anyways, it pops up with an objects required error. This code works for some other websites, I've tried it; however for the site i need to draw data from it doesn't seem to input anything into the username and password. I can't get it to interact with the website for some reason.


    Any ideas?
    Last edited by jdautel; 06-16-2016 at 05:39 PM.

  2. #2
    Registered User
    Join Date
    06-16-2016
    Location
    Austin
    MS-Off Ver
    10
    Posts
    2

    Re: Pulling Data From Password Protected Website Using VBA Macro

    also the #user and #pwd are the inputs from the source code for the username and password and the object #loginform is the input for logging in

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Excel 2016 - looking for script to get data from password protected website
    By harris1210 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-25-2016, 01:58 PM
  2. Replies: 0
    Last Post: 05-19-2014, 10:02 PM
  3. Import data from password protected php website (semicolon separated data)
    By JacobKM in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-20-2014, 09:10 AM
  4. How to download data from password protected website?
    By Excellearner2012 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-21-2013, 08:40 PM
  5. Replies: 1
    Last Post: 02-21-2013, 02:48 AM
  6. Importing/Refreshing Data from Password-Protected Website
    By daniel3417 in forum Excel General
    Replies: 5
    Last Post: 06-29-2012, 12:46 PM
  7. ByPassing Passwords when pulling stats from external password-protected files
    By jameztown in forum Excel Programming / VBA / Macros
    Replies: 35
    Last Post: 05-27-2010, 02:36 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1