From: Robert Klemme Date: 2012-11-09T17:08:19+09:00 Subject: Re: Ruby script to process html --20cf307f3518d78d5f04ce0b73cc Content-Type: text/plain; charset=ISO-8859-1 On Fri, Nov 9, 2012 at 7:09 AM, wrote: > Am 09.11.2012 03:28, schrieb Mario Trento: > > Depending on the formatting etc. of the real data, this could > get pretty difficult, but for your simple example data > iterating over the lines and using a regular expression > (with a named capture group) would work: > I find processing tag structures with line oriented tools pretty uncool. :-) In fact it's also error prone like you state yourself: But it certainly is not the "most cool way" and will break when > the html is formatted differently, like e.g. > > > ........**. > > > or > > > ... > ... > > Nokogiri rules! Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/ --20cf307f3518d78d5f04ce0b73cc Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable


On Fri, N= ov 9, 2012 at 7:09 AM, <sto.mar@web.de> wrote:
Am 09.11.2012 03:28, schrieb Mario Trento:

Depending on the formatting etc. of the real data, this could
get pretty difficult, but for your simple example data
iterating over the lines and using a regular expression
(with a named capture group) would work:

I find pr= ocessing tag structures with line oriented tools pretty uncool. :-)=A0 In f= act it's also error prone like you state yourself:

But it certainly is not the "most cool way" and will break when the html is formatted differently, like e.g.

<tr>
=A0 <td>...</td><td>...</td><td>...<= ;/td>
</tr>

or

<tr>
=A0 <td id=3D'whatever'>...</td>
=A0 ...
</tr>

Nokogiri rules!

Kind regards
robert

--
remember.guy do |as, often| as.you_= can - without end
http://= blog.rubybestpractices.com/
--20cf307f3518d78d5f04ce0b73cc--