PC Review


Reply
Thread Tools Rate Thread

automate internet explore to do google search...help

 
 
trint
Guest
Posts: n/a
 
      30th Apr 2009
I need to search for a certain product in Google (automatically) and
then take the Name, Address and Phone#'s off of each search results
and store them in this format:

Name:
Address:
Phone#:

Any help is appreciated.
Thanks,
Trint
 
Reply With Quote
 
 
 
 
trint
Guest
Posts: n/a
 
      6th May 2009
On May 4, 11:32*pm, Angel J. Hernández M. <angeljesu...@hotmail.com>
wrote:
> Hi there,
>
> Have you tried or considered using Accesibility API to "automate" the
> browser window?
>
> http://msdn.microsoft.com/en-us/acce...y/default.aspx
>
> Cheers,
>
> --
> Angel J. Hernández M
> MCP,MCAD,MCSD,MCDBA
> Microsoft MVPhttp://www.ajhsis.comhttp://msmvps.com/blogs/angelhernandez
>
> "trint" <trinity.sm...@gmail.com> wrote in message
>
> news:cb100348-e7ed-4d68-96ad-(E-Mail Removed)...
>
>
>
> > I need to search for a certain product in Google (automatically) and
> > then take the Name, Address and Phone#'s off of each search results
> > and store them in this format:

>
> > Name:
> > Address:
> > Phone#:

>
> > Any help is appreciated.
> > Thanks,
> >Trint- Hide quoted text -

>
> - Show quoted text -


Here is what I'm trying to do with my program:

1. Start Google.com:

object loc = "http://
www.google.com/";
object null_obj_str = "";
System.Object null_obj = 0;
this.axWebBrowser1.Navigate2(ref loc , ref null_obj, ref null_obj,
ref null_obj_str, ref null_obj_str);

2. Then start a search for all cargo ship companies:
2a. This works great because it starts a sight that has all the cargo
ship companies that I need on the page it finds and then starts:


HTMLInputElement otxtSearchBox = (HTMLInputElement) myDoc.all.item
("q", 0);

otxtSearchBox.value = "cargo ship companies";
// google html source for the I'm Feeling Lucky Button:
// <INPUT type=submit value="I'm Feeling Lucky" name=btnI>
//
HTMLInputElement btnSearch = (HTMLInputElement) myDoc.all.item
("btnI", 0);
btnSearch.click();

3. I want to take this page that is now in my browser started by my
program and put the source of the page in a string:
3a. This also works great and the string contains all of the "http://
addresses.com" that I want to grab out of the string:

mshtml.HTMLDocumentClass doc = (mshtml.HTMLDocumentClass)
this.axWebBrowser1.Document;
StringBuilder sb = new StringBuilder();
string str1 = "";

sb.Append(doc.documentElement.innerHTML);

str1 = sb.ToString();

4. Now, all I want are the .com addresses that are in this string
(str1) to be parsed out into a string array to look like this:
4a. This is where I am stuck now and don't have:

http://www.address1.com
http://www.address2.com
http://www.address3.com
http://www.address4.com
....etc.

any help is appreciated,
Thanks,
Trint
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Get rid of Google search & restore Classic Internet Search =?Utf-8?B?TkluYQ==?= Windows XP Internet Explorer 1 28th Feb 2006 10:58 PM
Internet Explore Cannot open the search page philip Windows XP Networking 2 28th Apr 2004 07:04 PM
Internet Explore Cannot open the search page philip Windows XP Networking 0 28th Apr 2004 03:18 PM
Internet Explore Cannot open the search page philip Windows XP Networking 0 28th Apr 2004 03:18 PM
Google search bar on MSN Internet Screen Jim W. Windows XP New Users 2 28th Mar 2004 04:48 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:59 AM.