From: Jonan Scheffler Date: 2012-11-09T11:17:19+09:00 Subject: Re: Ruby script to process html --047d7b625180f62d1b04ce068c50 Content-Type: text/plain; charset=ISO-8859-1 Anytime you're trying to parse HTML you want a gem called nokogiri. There's a lot of good documentation out there for it online. On Nov 8, 2012 6:14 PM, "Mario Trento" wrote: > Hi, > What would be the most cool way to process/parse html and write it out > in another format, kind of transpose mode. > e.g INPUT:=============================== > > type > id=M_btn_Mainl00 > home > > > clickAndWait > id=M_ct200_MainContent > > > > Wanted output:============================ > command: > command: ({ 'type', target: 'id=M_btn_Mainl00', value: 'home' }); > command: ({ 'clickAndWait', target: 'id=M_ct200_MainContent' }); // no > value > > > this to compose some fancy automation libs. I see the way to basically > read and capture lines by tugs , etc.. but feel should be more > better way. > > Tx > Dai > > -- > Posted via http://www.ruby-forum.com/. > > --047d7b625180f62d1b04ce068c50 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

Anytime you're trying to parse HTML you want a gem calle= d nokogiri. There's a lot of good documentation out there for it online= .

On Nov 8, 2012 6:14 PM, "Mario Trento"= <lists@ruby-forum.com> w= rote:
Hi,
What would be the most cool way to process/parse html and write it out
in another format, kind of transpose mode.
e.g INPUT:=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
<tr>
=A0 <td>type</td>
=A0 <td>id=3DM_btn_Mainl00</td>
=A0 <td>home</td>
</tr>
<tr>
=A0 <td>clickAndWait</td>
=A0 <td>id=3DM_ct200_MainContent</td>
=A0 <td></td>
</tr>

Wanted output:=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D
command:
command: ({ 'type', target: 'id=3DM_btn_Mainl00', value: &#= 39;home' });
command: ({ 'clickAndWait', target: 'id=3DM_ct200_MainContent&#= 39; }); =A0// no
value


this to compose some fancy automation libs. I see the way to basically
read and capture lines by tugs <tr>, <td> etc.. but feel should= be more
better way.

Tx
Dai

--
Posted via http://= www.ruby-forum.com/.

--047d7b625180f62d1b04ce068c50--