From: Xavier Noria Date: 2006-07-09T05:04:25+09:00 Subject: Re: WAtir usage On Jul 8, 2006, at 19:25, junkone@rogers.com wrote: > Hi > I found Watir and am excited to use it. I cannot find much examples in > terms of data scraping. I have gotne to a point wherei can use it to > submit form details. > I need to scrape data from the tables etc. How do i do it. > For eg my if ie is my browser object, how do i get the tables in the > page and extract data from 3 table in the page into a array? Watir is a wrapper around MSIE. In my limited experience crawling with Watir, besides reading its documentation I think it's good to study the underlying API, available here: http://msdn.microsoft.com/library/default.asp?url=/workshop/ browser/mshtml/reference/reference.asp In particular the interfaces IWebBrowser2, IHTMLDocument2, and IHTMLDocument3: http://msdn.microsoft.com/workshop/browser/webbrowser/reference/ ifaces/iwebbrowser2/iwebbrowser2.asp http://msdn.microsoft.com/workshop/browser/mshtml/reference/ifaces/ document2/document2.asp http://msdn.microsoft.com/workshop/browser/mshtml/reference/ifaces/ document3/document3.asp There you see what can be done grabbing the ie attribute of the Watir::IE object, in case the wrapping interface does not address some particular need. Additionally, I have found reading watir.rb very instructive, you have a better knowledge of what you are doing and may give context and idioms. -- fxn