Rugbyleary

New Member
Joined
Jul 31, 2015
Messages
1
Hello,
I am working on a project where I need to pull data from a website. The website requires that I sign in using a username, which I have already done. I then get taken to a landing "Home" page, but I need to navigate from that page to my desired webpage. From there I need to scrap the information and enter it into an existing excel file. For now, I'd like some help to navigate from the homepage to my desired webpage. Here is what I've done already:
  • Set controls for IE
  • Create Button in excel to initiate the VBA request
  • Written code to open IE and sign onto desired website (See below)
  • Opens website and takes me to the "Home" page

Below is the code that has worked thus far:

Private Sub GetData_Click()


Dim HTMLDoc As HTMLDocument
Dim MyBrowser As InternetExplorer

Dim MyHTML_Element As IHTMLElement

Dim MyURL As String

On Error GoTo Err_Clear

MyURL = "http://oxlive.dorseywright.com/login?c=FCC"

Set MyBrowser = New InternetExplorer
MyBrowser.Silent = True
MyBrowser.navigate MyURL
MyBrowser.Visible = True
Do

Loop Until MyBrowser.readyState = READYSTATE_COMPLETE
Set HTMLDoc = MyBrowser.document
HTMLDoc.all.Email.Value = "004jdje" 'Enter your email id here
For Each MyHTML_Element In HTMLDoc.getElementsByTagName("input")

If MyHTML_Element.Type = "submit" Then MyHTML_Element.Click: Exit For
Next


Err_Clear:
If Err <> 0 Then
Err.Clear
Resume Next
End If


While IE.readyState <> 4
DoEvents
Wend

End Sub

Now I need to navigate to a web page within this website and I'm stuck. I am new to the VBA world so my knowledge is incomplete but any help is greatly appreciated. Thank you!

Taylor
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

Forum statistics

Threads
1,214,918
Messages
6,122,257
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top