Hi,


I was trying to get the <th> from table as asked by Brad
http://www.mail-archive.com/wtr-general@rubyforge.org/msg06677.html. I was
using element_by_xpath and it didn't work and there was no reason why it
should not work. After investigating I came across the function
"create_rexml_document_object" in watir.rb, it was using "us-ascii"
encoding. Standard says we should use UTF-8 and this article (
http://www-128.ibm.com/developerworks/xml/library/x-utf8/) also says the
same. After changing the encoding to UTF-8 I could address all the <th>
using xpath.



This change should be checked-in in the main branch also, Bret can you give
me access right to check-in? or someone else also can check-in the change.



Brad you can find <th> using xpath something like this:



th =  ie.element_by_xpath("//th")

puts th.innerText



th =  ie.elements_by_xpath("//th")

for h in th do

puts h.innerText

end



Thanks

--
Prema Arya
_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to