Ciao a tutti, ho bisogno del vostro aiuto.
Non riesco a ricavare da una pagina html, tutti i link che mi servono,
utilizzando questo script
#main è la pagina scaricata in maniera corretta ed è di tipo String
er=Array.new
er << main['<div id="post_headerC" class="clearfix">(...)</div><hr>']
puts "Post search"
puts "Valore #{er.class}"
for i in er
puts i
end
Dove Sbaglio???
on 2012-09-22 23:41
on 2012-09-23 00:35
Perch non ti appoggi alla gemma nokogiri? :-) Il giorno sabato 22 settembre 2012, Andrea Rossi ha scritto:
on 2012-09-23 09:50
Andrea Pavoni wrote in post #1077137: > Perch non ti appoggi alla gemma nokogiri? :-) > > Il giorno sabato 22 settembre 2012, Andrea Rossi ha scritto: Ho risolto con hpricot XD
on 2012-09-23 10:36
> Perch non ti appoggi alla gemma nokogiri? :-) +1 I regexp non vanno bene per parsare HTML. "Some people, when confronted with a problem, think I know, I'll use regular expressions. Now they have two problems. " -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/
on 2012-09-23 11:14
David Welton wrote in post #1077151: >> Perch non ti appoggi alla gemma nokogiri? :-) > > +1 > > I regexp non vanno bene per parsare HTML. > > "Some people, when confronted with a problem, think > I know, I'll use regular expressions. Now they have two problems. " > > -- > David N. Welton > > http://www.welton.it/davidw/ > > http://www.dedasys.com/ L'ho notato, infatti sto usando nokogiri (grazie apeacox), in quanto hpricot sembra un progetto chiuso/abbandonato.
on 2012-10-08 13:48
On Sep 23, 2012, at 10:35:48 AM, David Welton wrote: > I regexp non vanno bene per parsare HTML. > > "Some people, when confronted with a problem, think > I know, I'll use regular expressions. Now they have two problems. " Obligatory: http://stackoverflow.com/a/1732454/69379 ~Marcello
on 2012-10-08 14:31
On 8 October 2012 13:48, Marcello Barnaba (void) <vjt@openssl.it> wrote: > > On Sep 23, 2012, at 10:35:48 AM, David Welton wrote: > > > I regexp non vanno bene per parsare HTML. > > > > "Some people, when confronted with a problem, think > > I know, I'll use regular expressions. Now they have two problems. " > > Obligatory: http://stackoverflow.com/a/1732454/69379 > "Chuck Norris *can* parse HTML with regex." Maurizio -- My profile <https://plus.google.com/100973969013103507046/about>
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.