ddelgado12
New Member
- Joined
- Dec 20, 2016
- Messages
- 1
Hi, I am trying to pull data from a web page via VBA (Power Query was painfully slow)... But the data I need requires a login before it will reveal itself. It looks like I am able to fill in my username and password just fine, but I am unsure how to get VBA to actually submit the form. I guess I'm not good at inspecting HTML elements, I'm sure this has an easy answer. Any help is appreciated. Here is what I have:
Code:
Sub process_Web_Data()
Dim ie As New SHDocVw.InternetExplorer
With ie
.Visible = True
.Navigate "[URL]https://www.muthead.com/login[/URL]"
While .Busy Or .ReadyState <> 4: DoEvents: Wend
With .Document
.getelementbyid("field-username").Value = "username"
.getelementbyid("field-loginFormPassword").Value = "password"
.getelementbyid("field-loginFormPassword").submit 'WHAT DO I DO HERE???
End With
While .Busy Or .ReadyState <> 4: DoEvents: Wend
Debug.Print .LocationURL
'-----------------
'do all of your other stuff here
'-----------------
End With
End Sub