Extract / scraping DIV data from website and copy to Excel

k0023382

New Member
Joined
Feb 25, 2010
Messages
45
Hi,
Here is the challenge.

In the past, elements were more or less fixed and was able to use my very well known method QueryTables under Workbooks.open

This website below has a "div", called "div.sidemeta" wihick contains the information I want to grab.
http://www.lynda.com/Web-Interactiv...ls page:1 s:relevance sa:true producttypeid:2


I have tried a different alternative:

Sub Test()
Dim IE As Object
Set IE = CreateObject("internetexplorer.application")
IE.Navigate "http://www.webiste.com"
IE.Visible = True

'Wait for the page to finish loading
Do While IE.Busy Or IE.ReadyState <> 4
DoEvents
Loop

'Get data
Set IEdoc = IE.document
Debug.Print IEdoc.body.innerhtml

IEdoc.Close
IE.Quit
End test



The data I get under "IEdoc.body.innerhtml" does not show that particular DIV.
I have tried using getElementById,getNamedItem and getElementByName without any luck.

Anybody knows how to this?
Thanks in advance.
 
I think this should probably be a new thread.

Code to scrape data needs to be rewritten for each page you want to scrape. So you would need a different solution, having had a quick look at the link, I would probably suggest something like dumping the returned data straight into excel and then using text to columns with a "," delimiter
 
Upvote 0

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

Forum statistics

Threads
1,223,246
Messages
6,170,996
Members
452,373
Latest member
TimReeks

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