# Mechaniza/REXML extract\_from\_table

**URL:** <https://www.ruby-forum.com/t/mechaniza-rexml-extract-from-table/64127>\
**Category:** Ruby\
**Created:** [June 22, 2006, 10:06am UTC](https://www.ruby-forum.com/t/mechaniza-rexml-extract-from-table/64127 "2006-06-22T10:06:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Horacio\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/97f17d/32.png) [@Horacio\_S](https://www.ruby-forum.com/u/Horacio_S)\
**Post date:** [June 22, 2006, 10:06am UTC](https://www.ruby-forum.com/t/mechaniza-rexml-extract-from-table/64127/1 "2006-06-22T10:06:09Z")

</div>

Has anyone been successfull using the extract\_from\_table method of  
REXML::Node  
class??

This methods is an extension added by Mechanize to REXML as I can see in  
the  
source code but I am unable to use it because it complains of private  
method  
called…

here is the code I am trying

require ‘mechanize’

agent = WWW::Mechanize.new  
page = agent.get(“[http://test.ts](http://test.ts)”)

cols = page.root.extract\_from\_table(page.root, [“col1”, “col2”])

and I get

NoMethodError: private method ‘extract\_from\_table’ called for   
…  
\</\>:REXML::Document

regards.  
Horacio

---

<div class="post-metadata">

**Author:** ![Horacio\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/97f17d/32.png) [@Horacio\_S](https://www.ruby-forum.com/u/Horacio_S)\
**Post date:** [June 22, 2006, 11:50pm UTC](https://www.ruby-forum.com/t/mechaniza-rexml-extract-from-table/64127/2 "2006-06-22T23:50:33Z")

</div>

On Thu, Jun 22, 2006 at 05:05:41PM +0900, Horacio S. wrote:

> require ‘mechanize’
> 
> agent = WWW::Mechanize.new  
> page = agent.get(“[http://test.ts](http://test.ts)”)
> 
> cols = page.root.extract\_from\_table(page.root, [“col1”, “col2”])

Try this:

cols = extract\_from\_table(page.root, [“col1”, “col2”])

–Aaron
