def google_search(query)

  require 'win32ole'

  ie = WIN32OLE.new('InternetExplorer.Application')
  ie.visible = true

  ie.gohome

  ie.Navigate("http://google.com?q=#{query}")

end

google_search("ruby")



-r.



christopher.j.meisenzahl / citicorp.com wrote:

>Thanks very much for the MSDN link whoever sent it! I accidentally deleted your 
>original message, but I did get the link.  :-)
>
>
>I've been able to do this:
>
>########
>require 'win32ole'
>
>ie = WIN32OLE.new('InternetExplorer.Application')
>ie.visible = true
>
>ie.gohome
>
>ie.Navigate("http://google.com")
>######################################
>
>
>But now I would like to be able to get/set the value in the google search text 
>box. Can anyone show me how to do this?
>I've been digging through the MSDN stuff, but I'm afraid I'm in a bit over my 
>head here.  :-(
>
>Would I need to somehow query IE to find out what text objects were on the 
>form? And then set them to the value I want? How would I then press the Search 
>button, or fire that event?
>
>
> 
> 
>Christopher J. Meisenzahl CPS, CSTE
>Managing Consultant - Software Testing
>Spherion Technology
>christopher.j.meisenzahl / citicorp.com
>
>
>
>-----Original Message-----
>From: Meisenzahl, Christopher J. 
>Sent: Monday, April 28, 2003 3:22 PM
>To: 'ruby-talk / ruby-lang.org'
>Subject: Manipulate IE via Ruby? ...
>
>
>I want to tinker with the concept of Windows Automation as described in chapter 
>16 of the PickAxe book.
>
>Does anyone know where I can find the list of objects that can be manipulated 
>in IE via Ruby? Page 167 shows me how to launch IE, make it visible, and 
>navigate the "home" page. But I assume that so much more is possible. Can 
>anyone point me in the right direction?
>
>If I could get to the point of navigating and filling in forms that would be 
>great!
>
>
>Thanks very much in advance,
>
>Christopher
>
> 
> 
>Christopher J. Meisenzahl CPS, CSTE
>Managing Consultant - Software Testing
>Spherion Technology
>christopher.j.meisenzahl / citicorp.com
>
>
>  
>

-- 
--------------------------------------------------------
Rodrigo Bermejo              | rodrigo.bermejo / ps.ge.com  
IT-Specialist                | 8*879-0644             
--------------------------------------------------------