# How to read table's cell in ruby?

**URL:** <https://www.ruby-forum.com/t/how-to-read-tables-cell-in-ruby/89876>\
**Category:** Ruby\
**Created:** [March 23, 2007, 1:35pm UTC](https://www.ruby-forum.com/t/how-to-read-tables-cell-in-ruby/89876 "2007-03-23T13:35:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![deepak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7bcc69/32.png) [@deepak](https://www.ruby-forum.com/u/deepak)\
**Post date:** [March 23, 2007, 1:35pm UTC](https://www.ruby-forum.com/t/how-to-read-tables-cell-in-ruby/89876/1 "2007-03-23T13:35:52Z")

</div>

Hello,

Can anyone tell me how to read cells of a table on a webpage?  
plz tell me methods.

Thanks in Advance  
Deepak

---

<div class="post-metadata">

**Author:** ![deepak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7bcc69/32.png) [@deepak](https://www.ruby-forum.com/u/deepak)\
**Post date:** [March 23, 2007, 1:43pm UTC](https://www.ruby-forum.com/t/how-to-read-tables-cell-in-ruby/89876/2 "2007-03-23T13:43:33Z")

</div>

Deepak Kumar Shivhare wrote:

> Can anyone tell me how to read cells of a table on a webpage?  
> plz tell me methods.

Take a look at Hpricot: [http://code.whytheluckystiff.net/hpricot/](http://code.whytheluckystiff.net/hpricot/)

---

<div class="post-metadata">

**Author:** ![deepak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7bcc69/32.png) [@deepak](https://www.ruby-forum.com/u/deepak)\
**Post date:** [March 23, 2007, 2:01pm UTC](https://www.ruby-forum.com/t/how-to-read-tables-cell-in-ruby/89876/3 "2007-03-23T14:01:41Z")

</div>

Deepak Kumar Shivhare wrote:

> Hello,
> 
> Can anyone tell me how to read cells of a table on a webpage?  
> plz tell me methods.

Check out scRUBYt!:

[http://scrubyt.org](http://scrubyt.org)

Quick example:

# Input

| 1 | 2 |
| 3 | 4 | 5 |

  

| 6 |
| 7 |
| 8 |

  

| 9 | 10 |
|
| |
| 11 |

 =================================================================

scRUBYt program to extract all the cells:

=================================================================  
table\_data = Scrubyt::Extractor.define do

```
 fetch "input.html"

 cell '1'

```

# end

output:

# ================================================================= 1 2 3 4 5 6 7 8 9 10 11

Cheers,  
Peter  
\_\_  
[http://www.rubyrailways.com](http://www.rubyrailways.com) :: Ruby and Web2.0 blog  
[http://scrubyt.org](http://scrubyt.org) :: Ruby web scraping framework  
[http://rubykitchensink.ca/](http://rubykitchensink.ca/) :: The indexed archive of all things Ruby
