From: "Aurélien AMILIN" Date: 2010-04-11T20:29:35+09:00 Subject: Re: how to analyse web with nokogiri? --00032555b3e6994fb00483f457e6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 1\ css("table tr td") will create an array of all td elements of the I've passed to Nokogiri::HTML() method, that's why I can call the each meth= o on the result 2\ You'v got a table with 3 columns (1 for title, and 2 for values) so i use the modulo (%, it's a math function : 0%3=3D0; 1%3=3D1; 2%3=3D2; 3%3=3D0; 4= %3=3D1 ..) function to place all the data at the right index result[i%3] ||=3D "" means if result[i%3] is nil then put an empty string i= nto it #{} helps to include a string into another, here i use #{} to add a ; at th= e end of the string 2010/4/11 Pen Ttt > think AMILIN Aur=E9lien ,i get it > i am a beginner,there are some problems : > 1\ > what is the meaning of css("table tr td")? > > 2\ > what is the meaning of > result[i%3] ||=3D "" #let nil be result array?? > what is i%3 and || ? > result[i%3] << "#{td.content};" #td.content is the td value,i know > what is #{ } ? > > > > > > > -- > Posted via http://www.ruby-forum.com/. > > --00032555b3e6994fb00483f457e6--