Try ie.div(:class, testing_1).html instead...
Regards,
John
On Jan 13, 10:20 am, Soori sure...@gmail.com wrote:
All
I am capturing the the text inside a div as mentioned below,
divdiv class=testing_1
divtestdata1/div
divtest data2/div
divtest:data3/div/div
ie.div(:class,
Hi John,
.html will return the html with DIV,etc,
I would like to get only the text inside the div .
Thanks,
Soori
On Jan 13, 3:30 pm, John Kolokotronis johnj...@gmail.com wrote:
Try ie.div(:class, testing_1).html instead...
Regards,
John
On Jan 13, 10:20 am, Soori sure...@gmail.com
Something like this should work (not tested):
browser.div(:class, testing_1).divs.each {|div| puts div.text}
Željko
--
watir.com - community manager
watirpodcast.com - host
--
You received this message because you are subscribed to the Google Groups
Watir General group.
To post to this group,
I thought you wanted all the text, with the div tags? Are you trying
to get testdata1, test data2, etc then?
If so, they are in another div, not the testing_1 class, so I'd use
xpath for each one, like this:
ie.element_by_xpath(//d...@class = 'testing_1']/div[1]).text # and
div[2], div[3], etc.
Following should serve your purpose:
ie.div(:class, testing_1).divs.each do |dv|
puts dv.text
-Prajakta
On Wed, Jan 13, 2010 at 4:41 PM, Soori sure...@gmail.com wrote:
Hi John,
.html will return the html with DIV,etc,
I would like to get only the text inside the div .
Thanks,
Soori