PDA

View Full Version : Extract Data under Hyperlinks from a webpage in excel



vishwakarma
11-02-2010, 12:03 AM
Hello Guys,

Is it possible to extract data from hyperlinks(on a web page) in excel.

In the pasted link :- http://www.eibtm.com/page.cfm/Action=ExhibList/ListID=1/PageNum=4/loadSearch=231272_540

there are list of 2972 exhibitors. I want to extract all the exhibitors names and all the info under the names hyperlinks.

If that can be done it would be very helpful for me as it is not possible to it manually and will take ample amount of time....


Thanks in advance..


Manoj

Tinbendr
11-02-2010, 03:36 AM
2010
Data -> From Web - Navigate to page - Click upper left yellow arrow. -> Import

vishwakarma
11-02-2010, 03:52 AM
Thanks,

I already knew about it, the problem with this option is that it only gives me the visible data on the web-page and not the data under the named hyperlinks(I want to extract that too).

I need a vba code to extract all exhibitors names and all the info under the names(company's) hyperlinks.

Please help me out...: pray2:

Manoj...

vishwakarma
11-02-2010, 09:43 PM
Can anyone help me on this...


Thanks...

mdmackillop
11-03-2010, 01:39 AM
View the Web Page source, copy and paste it into excel.
Examine it to find the start and end of yor required data and remove the rest.
Determine the text that "identifies" your required field an delete any lines not containing it.
Look for a pattern in the remaining lines if required to further isolate the data you need.

vishwakarma
11-03-2010, 04:49 AM
Thanks for the guidance...mdmackillop (http://www.vbaexpress.com/forum/member.php?u=87), I tried your instructions but it will still not work for me...It is taking time and is a manual work.

I need a vba through which I can click on the hyperlinks(name of exhibitors) on every page and copy the data(details of the exhibitors) from the web-page and paste it on the excel...:mkay

mdmackillop
11-03-2010, 09:28 AM
If you can find and post identifiers for the data you need, we can look at the code to use these. Can you post an excel extract highlighting the rows/data you require.

stanl
11-03-2010, 01:13 PM
Hello Guys,

Is it possible to extract data from hyperlinks(on a web page) in excel.

In the pasted link :- http://www.eibtm.com/page.cfm/Action=ExhibList/ListID=1/PageNum=4/loadSearch=231272_540

there are list of 2972 exhibitors. I want to extract all the exhibitors names and all the info under the names hyperlinks.
Manoj

If you are using IE browser you can write a sub of DHTML code to gather the href tags. Since your initial URL does not contain all exhibitors, you will require an addtional loop from page 1 to page 21... i.e.

http://www.eibtm.com/page.cfm/Action=ExhibList/ListID=1/PageNum=1

To

http://www.eibtm.com/page.cfm/Action=ExhibList/ListID=1/PageNum=21

and for each anchor from browserObject.Document.Body.GetElementsByTagName("A")

you can parse

GetAttribute("innerHTML")
GetAttribute("innertext")
GetAttribute("href")

and that will get what you need. .02 Stan

vishwakarma
11-03-2010, 08:23 PM
Thanks mdmackillop (http://www.vbaexpress.com/forum/member.php?u=87)/Stanl for the replies,

Stanl..can you please give a small example of the coding...it would be very helpful for me for the start as I don't have the knowledge of VBA and very confused to how to start...:dunno

vishwakarma
11-07-2010, 10:04 PM
Stanl..can you please give a small example of the coding...it would be very helpful for me for the start as I don't have the knowledge of VBA and very confused to how to start...:dunno

Can I expect any update... Thanks...

vishwakarma
11-09-2010, 11:35 PM
Hello Guys...

Sorry to disturb you people again and again, but can anyone help me on this.

I m really looking forward to this...

Every time I got stuck on any VBA problem I always look forward to this forum and I know I will get help from you guys.

I have very limited knowledge of VBA but can modify the vba codes as per my requirements, please if any one can help me on this...even a sample code will work for me.:(