To import results from web pages

mohanyathish

New Member
Joined
Apr 21, 2011
Messages
48
i am using web queries to import data from web pages...

for example

www.quantcast.com/google.com/traffic
www.qauntcast.com/cnet.com/traffic

if u notice from the above examples, that only the name of the site in the url is changing

i am doing it for evry site manually...

is there any way wherein i can just run a macro for a list of sites, and the values wil get extracted into the excel..?

the site list will be something like this...

google.com
cnet.com
pcmag.com
etc.

Sub test()
Dim ipstring As String
Application.DisplayAlerts = False

ipstring = "http://quantcast.com/google.com/traffic"

With ActiveSheet.QueryTables.Add(Connection:="URL;" _
& ipstring, Destination:=Range("a1"))
.BackgroundQuery = True
.RefreshStyle = xlOverwriteCells
.Refresh BackgroundQuery:=False
.SaveData = True
End With


End Sub

i have been able to get so far right now...

for google.com.....i just need these values.....

<table border="0" cellpadding="0" cellspacing="0" width="326"><col style="width: 157pt;" width="209"> <col style="width: 88pt;" width="117"> <tbody><tr style="height: 15.75pt;" height="21"> <td class="xl67" style="height: 15.75pt; width: 157pt;" height="21" width="209">Data</td> <td class="xl64" style="width: 88pt;" width="117">US</td> </tr> <tr style="height: 15.75pt;" height="21"> <td class="xl68" style="height: 15.75pt; width: 157pt;" height="21" width="209">Visits per Month</td> <td class="xl65" style="width: 88pt;" width="117">4,665,036,939</td> </tr> <tr style="height: 15.75pt;" height="21"> <td class="xl69" style="height: 15.75pt; width: 157pt;" height="21" width="209">People per Month</td> <td class="xl66" style="width: 88pt;" width="117">151,582,624</td> </tr> </tbody></table>
same table for other wesites as well

i dont know how to change the url to extract the values

kindly help...
 
Last edited:

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

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