Link to home
Start Free TrialLog in
Avatar of mbgupta
mbgupta

asked on

Reading a Hyperlink on a Web Page

Hi Experts,

This is what i am trying.
Through a VB Program, i want to open a browser, and go to a perticular web page on the Internet. For eg i open
http://www.google.com/search?hl=en&ie=UTF8&oe=UTF8&q=Mohit

Now i want to go to the web page which is the first Hyperlink of the Search result.

Can i do this

Meaning the Link will say "Mohit Gupta's Homepage"
and the source will be say "www.mohit.com"

Can i get the source code i.e. "www.mohit.com"
through the VB Program - or can i some how go to this web page through my VB program.

I will be greatful if you can help me in achiving this.

Thanks a bunch in anticipation!!!!

Regards
Mohit
ASKER CERTIFIED SOLUTION
Avatar of bobbit31
bobbit31
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You might be interested in looking at the Microsoft Internet Transfer ActiveX control.  With the control, you could easily get the contents of a webpage.  ie:

Dat = Inet1.OpenURL("http://www.google.com/search?hl=en&ie=UTF8&oe=UTF8&q=Mohit")

Dat would be the HTML information on the page.  You can then parse the Dat, and find the first search result link.

I hope this helps.  Good luck!
Avatar of Richie_Simonetti
I am more or less with Bobbit but for second approach, you could use HTML Object library to do it (parse stuff) and you get the advantage of Object model.
Avatar of mbgupta
mbgupta

ASKER

Thanks very much!!!
your welcome :)