VBA Web Extraction Issue

JokelesComedian

Board Regular
Joined
Mar 26, 2012
Messages
85
This is the code that google found for me. The web site I want to get data from has frames. You have to click certin buttons on the site to get to that page. Is there a way to do this? Here is the VBA I am working with.

Sub Test()
Dim IE As Object

Set IE = CreateObject("InternetExplorer.Application")
With IE
.Visible = True
.Navigate "http://www.aarp.org/" ' should work for any URL
Do Until .ReadyState = 4: DoEvents: Loop

x = .document.body.innertext
x = Replace(x, Chr(10), Chr(13))
x = Split(x, Chr(13))
Range("A1").Resize(UBound(x)) = Application.Transpose(x)

.Quit
End With

End Sub

This pulls info from the AARP site but the site I need to pull from at work has frames.

JokelesComedian
Excel 2010
IE 7
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Try this to see if you can get directly to the page in the frame...

1. Open the site in your browser
2. Navigate to the page that has the frame you want
3. Click View in the menu bar (Don't right click view, you just get the frame source)
4. You should see the main page with the frame pages listed
5. Copy the URL from the frame you want and append it to the url of the page (might take a little fiddling to get it to the right place)

If this gives the results you want, then use that URL in your .Navigate
 
Upvote 0
Thank you eblake for your fast response, but the only View I see is View Source. When I look at the Source, I see frameset then some stuff after that. Is that what I am supposed to copy? I dont think I am explaining this correctly.
 
Upvote 0
Yes, you should see something like:

<frame name="fname" scrolling="no" noresize target="contents" src="page1.htm">
<frame name="contents" target="main" src="page2.htm" scrolling="auto">
<frame name="main" src="page3.htm" target="_self" scrolling="auto">

You need to figure out which one of those has the page you want, then add the src to the url of the page, that "should" get you directly to the page.
 
Upvote 0

Forum statistics

Threads
1,211,987
Messages
6,105,226
Members
447,957
Latest member
Basildon

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