From: William James Date: 2006-07-15T12:45:05+09:00 Subject: Re: Win32OLE Question Masaki Suketa wrote: > Hello, > > In message "Re: Win32OLE Question" > on 06/07/09, "studlee2@gmail.com" writes: > > > Ha! Good point, however the good folks at PhoneTrick have measures in > > place to make sure people are abused or harrassed. > > > > The main point is how do you get the focus on an object that doesn't > > have a name - in this case the nameless button? Any ideas? > > Does the following example help you? > # > # The HTML file is following. The button does not have id. > # (But they have value.) > # > # > # > # > # > # > # > require 'win32ole' > ie = WIN32OLE.new('InternetExplorer.Application') > ie.visible = true > ie.navigate(URL_OF_HTML_FILE) > while ie.busy > sleep 1 > end > > # get button1 > button1 = nil > ie.document.all.tags("input").each do |i| > if i.value == "button1" > button1 = i > break > end > end Very instructive. Thanks. > > # button1.click > if button1 > button1.click() > end > > Regards > Masaki Suketa