How to Read Text from Webipage when its disabled

R

Rase In

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:eek:nce 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

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML Strict//EN"><META
http-equiv="Content-Type" content="text/html; charset=utf-8"> <HTML
xmlns="http://www.w3.org/1999/xhtml"><BODY><TABLE
class="width100"><TBODY><TR><TD class="noSurround"><TABLE
class="size100"><TBODY><TR><TD class="valignTop size100
noSurround"><TABLE class="size100"><TBODY><TR class="height100"><TD
class="valignTop"><FORM id="policyForm" name="policyForm"
action="/nw/policy/details/premium.xhtml" method="post" target=""><TABLE
class="data" style="WIDTH: 100%; BACKGROUND-COLOR: #c2c5ca"
cellSpacing="0" cellPadding="0" border="0"><TBODY><TR><TD><TABLE
class="table_style" cellSpacing="0" cellPadding="1"><TBODY
id="policyForm:_id69:tbody_element"><TR class="oddRow"> <TD
class="cell_align_right">$3,498.36</TD>
</TR></TBODY></TABLE></TD></TR></TBODY></TABLE></FORM></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></BODY></HTML>
 
M

Mark Thomas

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:eek:nce 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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top