yes for now this is the best solution I have. On 11/4/09, Wesley Chen <cjq....@gmail.com> wrote: > Thank you very much. > Only this way to get the meta data? I think it is not convenient enough. > > Thanks. > Wesley Chen. > For life, the easier, the better. > > > On Tue, Nov 3, 2009 at 10:41 PM, chandu.tennety > <chandu.tenn...@gmail.com>wrote: > >> >> Marlon, >> Your original code works for me: >> >> {"Content-Type"=>"text/html; charset=iso-8859-1", "keywords"=>"title"} >> >> Chandu >> >> On Nov 2, 10:51 pm, Marlon <marlonmoja...@gmail.com> wrote: >> > I found the part of the solution herehttp:// >> groups.google.com/group/watir-general/browse_thread/thread/566... >> > it still did not solve my problem. >> > >> > *sample html* >> > >> > <html> >> > <head> >> > <title>title</title> >> > <meta content="title" name="keywords"/> >> > <meta content="text/html; charset=iso-8859-1" >> > http-equiv="Content-Type"/> >> > >> > *ruby file* >> > >> > require 'watir' >> > require 'test/unit' >> > >> > class TC_MyTest < Test::Unit::TestCase >> > >> > def test_meta_get >> > $ie = Watir::IE.start('<url to check>') >> > d=meta($ie) >> > puts d >> > end >> > >> > def meta( browser ) >> > meta = {} >> > bmeta = >> > browser.document.body.parentElement.getElementsByTagName( "META" ) >> > bmeta.each do |i| >> > k = i.name >> > if k == "" >> > k = i.httpEquiv >> > end >> > meta[ k ] = i.content >> > end >> > return meta >> > end >> > end >> > >> > this produces: >> > >> > Content-Typetext/html; charset=iso-8859-1title keywords >> > >> > I what to be able to get first meta tag "name" attribute which is >> "*keywords >> > *" >> > >> > many thanks again! >> > Marlon >> >> > >> > > > >
-- Thanks! Marlon M. Mojares +639291625097 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~----------~----~----~----~------~----~------~--~---