# How to Read Text from Webipage when its disabled

**URL:** <https://www.ruby-forum.com/t/how-to-read-text-from-webipage-when-its-disabled/167887>\
**Category:** Ruby\
**Created:** [May 13, 2009, 5:25pm UTC](https://www.ruby-forum.com/t/how-to-read-text-from-webipage-when-its-disabled/167887 "2009-05-13T17:25:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rasein](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/46a35a/32.png) [@rasein](https://www.ruby-forum.com/u/rasein)\
**Post date:** [May 13, 2009, 5:25pm UTC](https://www.ruby-forum.com/t/how-to-read-text-from-webipage-when-its-disabled/167887/1 "2009-05-13T17:25:39Z")

</div>

the webpage i m testing has many list box, text box, radio butons etc…  
and it has Text field which is in Diabled and its not Text box;  
eg:once after registering in website, the name field bcomes disabled and  
its in Table format…

find the attached screen and element source Base Premimum…how to read  
the datas and store it in exce,csv or anything

\<META

http-equiv=“Content-Type” content=“text/html; charset=utf-8”\>

 $3,498.36

|
| |
| |
|
| |

---

<div class="post-metadata">

**Author:** ![rasein](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/46a35a/32.png) [@rasein](https://www.ruby-forum.com/u/rasein)\
**Post date:** [May 13, 2009, 6:25pm UTC](https://www.ruby-forum.com/t/how-to-read-text-from-webipage-when-its-disabled/167887/2 "2009-05-13T18:25:43Z")

</div>

On May 13, 11:25 am, Rase In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> the webpage i m testing has many list box, text box, radio butons etc…  
> and it has Text field which is in Diabled and its not Text box;  
> eg:once after registering in website, the name field bcomes disabled and  
> its in Table format…

A table is not the same thing as a disabled input control. However, it  
doesn’t really matter when all you want to do is extract the data.

> find the attached screen and element source Base Premimum…how to read  
> the datas and store it in exce,csv or anything

You read the data the same way you’d read any HTML data, with an HTML  
parser. First, you determine how to uniquely and consistently identify  
the data you want to extract. Second, you construct an expression to  
extract it.

I will provide an example using Nokogiri. Let’s assume that you want  
the dollar value that is always in the TD under the TBODY that has and  
id of “policyForm:\_id69:tbody\_element”. Here’s what you can do:

doc = Nokogiri::HTML(html)  
puts doc.search(‘//tbody[@id=“policyForm:\_id69:tbody\_element”]/tr/  
td’).inner\_html

– Mark.
