Can we read webpage grid data into an excel?

Hi,

I am using one third party web application, where in one pag all the
data is presented in grid format.

But i am not able to understand how should i read such grid html table
stored values?

Any help in this regard?

I recommend handing the table’s HTML to Nokogiri and letting it do the
parsing for you.

For example (using “driver” as Firefox with watir-webdriver):

require ‘nokogiri’
doc = Nokogiri::HTML(driver.table(:id => ‘example’).html)

doc.css(‘tr’).each do |row|
row.css(‘td’).each do |cell|
puts cell.text
end #Cell loop
end #Row loop

On Fri, Jan 11, 2013 at 10:13 PM, Arup R. [email protected]
wrote:

Hi,

I am using one third party web application, where in one pag all the
data is presented in grid format.

But i am not able to understand how should i read such grid html table
stored values?

Any help in this regard?

The easiest way is to use an HTML parser such as Nokogiri, and then
use xpath to get at the values.

Jesus.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs