From: Xavier Noria Date: 2006-06-28T02:53:26+09:00 Subject: how to wrap methods of WIN32OLE objects I am doing screen-scraping with Explorer: WIN32OLE.new('InternetExplorer.Application') When you ask explorer to send some request and the method returns it may need yet some time to complete building the DOM etc., and you need to do something like: def wait_for_completion sleep 1 while @ie.busy sleep 1 while @ie.readyState != 4 sleep 1 while @ie.document.readyState != 'complete' end Since there is no class to subclass I tried to wrap the method to submit simple requests (Navigate) like this: # untested original_navigate = @ie.method(:Navigate) def @ie.navigate(url) original_navigate(url) wait_for_completion end but it turns out that @ie is an object of class WIN32OLE that has no :Navigate method (so the program dies in that @ie.method (:Navigate)). Perhaps this has something to do with late binding. Do you know any way to do that? -- fxn