# How to get the row size of the html's table?

**URL:** <https://www.ruby-forum.com/t/how-to-get-the-row-size-of-the-htmls-table/186018>\
**Category:** Ruby\
**Created:** [March 30, 2010, 1:40pm UTC](https://www.ruby-forum.com/t/how-to-get-the-row-size-of-the-htmls-table/186018 "2010-03-30T13:40:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![luofeiyu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9de0a6/32.png) [@luofeiyu](https://www.ruby-forum.com/u/luofeiyu)\
**Post date:** [March 30, 2010, 1:40pm UTC](https://www.ruby-forum.com/t/how-to-get-the-row-size-of-the-htmls-table/186018/1 "2010-03-30T13:40:56Z")

</div>

in vb, we can use webbrowaer to get tables row.  
for example,

webbrowser1.document.getElementsByTagName(“table”)(0).rows.length

then we can get the row size of html’table 1

if i have a html file(/home/name/test.html) , there are many tables in  
it , how can i use ruby to get the row size of html’table 1,such as  
webbrowser1.document.getElementsByTagName(“table”)(0).rows.length (vb)

---

<div class="post-metadata">

**Author:** ![luofeiyu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9de0a6/32.png) [@luofeiyu](https://www.ruby-forum.com/u/luofeiyu)\
**Post date:** [March 30, 2010, 4:58pm UTC](https://www.ruby-forum.com/t/how-to-get-the-row-size-of-the-htmls-table/186018/2 "2010-03-30T16:58:37Z")

</div>

Hi,

I think this might be useful  
[http://soledadpenades.com/2007/06/15/extracting-data-with-hpricot/](http://soledadpenades.com/2007/06/15/extracting-data-with-hpricot/)
