jeos-8.04.1-jeos-i386.iso 01-Jul-2008 04:59 104361984 ubuntu-8.10-desktop-amd64.iso 14-Nov-2008 14:53 732989440A basic directory listing with links to the files, timestamp and size. I did the following to get the file names: doc.search('a').map { |link| link['href'] } But I also need to get the size which is essentially in the third column. How would I go about doing this in nokogiri? Any/all advice would be appreciated. Thanks! -Joe -- Name: Joseph A. Williams Email: joe at joetify.com Blog: http://www.joeandmotorboat.com/ From mike.tracy at gmail.com Tue Jun 9 23:12:23 2009 From: mike.tracy at gmail.com (Mike Tracy) Date: Tue, 9 Jun 2009 22:12:23 -0500 Subject: [Nokogiri-talk] parsing html with tabs In-Reply-To: <20090609181740.3c218afe@der-dieb> References: <20090609181740.3c218afe@der-dieb> Message-ID: <3dd5da120906092012h62f72c71icd74a4fcf4f92af0@mail.gmail.com> use .next_sibling something like: irb(main):015:0> doc.search('a').map { |l| [ l['href'],l.next_sibling.to_s.split(" ")[-1] ] } => [["jeos-8.04.1-jeos-i386.iso", "104361984"], ["ubuntu-8.10-desktop-amd64.iso", "732989440"]] -mt On Tue, Jun 9, 2009 at 8:17 PM, Joe Williams
> jeos-8.04.1-jeos-i386.iso > 01-Jul-2008 04:59 ? ? ? ? ? 104361984 href="ubuntu-8.10-desktop-amd64.iso">ubuntu-8.10-desktop-amd64.iso > 14-Nov-2008 14:53 ? ? ? ? ? 732989440 >> > A basic directory listing with links to the files, timestamp and > size. I did the following to get the file names: > > doc.search('a').map { |link| link['href'] } > > But I also need to get the size which is essentially in the third > column. How would I go about doing this in nokogiri? Any/all advice > would be appreciated. > > Thanks! > > -Joe > > > -- > Name: Joseph A. Williams > Email: joe at joetify.com > Blog: http://www.joeandmotorboat.com/ > _______________________________________________ > Nokogiri-talk mailing list > Nokogiri-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/nokogiri-talk > From joe at joetify.com Wed Jun 10 01:28:24 2009 From: joe at joetify.com (Joe Williams) Date: Tue, 9 Jun 2009 22:28:24 -0700 Subject: [Nokogiri-talk] parsing html with tabs In-Reply-To: <3dd5da120906092012h62f72c71icd74a4fcf4f92af0@mail.gmail.com> References: <20090609181740.3c218afe@der-dieb> <3dd5da120906092012h62f72c71icd74a4fcf4f92af0@mail.gmail.com> Message-ID: <20090609222824.1db11d69@der-dieb> Thanks guys, both solutions worked well. -Joe On Tue, 9 Jun 2009 22:12:23 -0500 Mike Tracy
> > jeos-8.04.1-jeos-i386.iso > > 01-Jul-2008 04:59 ? ? ? ? ? 104361984 > href="ubuntu-8.10-desktop-amd64.iso">ubuntu-8.10-desktop-amd64.iso > > 14-Nov-2008 14:53 ? ? ? ? ? 732989440 > >> > > > A basic directory listing with links to the files, timestamp and > > size. I did the following to get the file names: > > > > doc.search('a').map { |link| link['href'] } > > > > But I also need to get the size which is essentially in the third > > column. How would I go about doing this in nokogiri? Any/all advice > > would be appreciated. > > > > Thanks! > > > > -Joe > > > > > > -- > > Name: Joseph A. Williams > > Email: joe at joetify.com > > Blog: http://www.joeandmotorboat.com/ > > _______________________________________________ > > Nokogiri-talk mailing list > > Nokogiri-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/nokogiri-talk > > > _______________________________________________ > Nokogiri-talk mailing list > Nokogiri-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/nokogiri-talk -- Name: Joseph A. Williams Email: joe at joetify.com Blog: http://www.joeandmotorboat.com/ From vamlists at gmail.com Thu Jun 11 19:40:56 2009 From: vamlists at gmail.com (Vamsee Kanakala) Date: Fri, 12 Jun 2009 05:10:56 +0530 Subject: [Nokogiri-talk] style, script and comments getting scrubbed in before/after Message-ID: <4A319608.2080601@gmail.com> Hi, I'm trying to add a chunk of html to the beginning/end of a node with before/after methods in Node or NodeSet any style,script tags are scrubbed of their contents, though attributes are still available. Also, I noticed that html comments are also ignored. Something like this: |doc.xpath("//head/*[1]").before("") And I try to display it, this is what I get: ||hdoc.xpath("//head/*[1]") => | Am I missing something? Thanks, Vamsee. From aaron.patterson at gmail.com Sat Jun 13 16:31:21 2009 From: aaron.patterson at gmail.com (Aaron Patterson) Date: Sat, 13 Jun 2009 13:31:21 -0700 Subject: [Nokogiri-talk] Trouble with xpath In-Reply-To: <42dc968d0906131301v61a5e149pa8abd6c10f4f5a1@mail.gmail.com> References: <42dc968d0906131301v61a5e149pa8abd6c10f4f5a1@mail.gmail.com> Message-ID: <6959e1680906131331p5e6514dek8720480c4d8b1cf5@mail.gmail.com> Hi Alf, On Sat, Jun 13, 2009 at 1:01 PM, Alf Mikula
| 2009-04-01 | CABC | ...||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2009-04-01 | > ? ? ?CABC | > ? ? ?...||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Base | Quote | Date | Type | Rate | Source | |
|---|---|---|---|---|---|---|
| CAD | EUR | 2009-06-05 | CLSE | 1.555452 | CA: 0.6429 EUR = 1 CAD 2009-06-04 Bank of Canada closing rate | |
| Show | Edit | Destroy | ||||
| CAD | GBP | 2009-06-05 | CLSE | 1.774938 | CA: 0.5634 GBP = 1 CAD 2009-06-04 Bank of Canada closing rate | |
| Show | Edit | Destroy | ||||
| CAD | JPY | 2009-06-05 | CLSE | 0.011340 | CA: 88.1834 JPY = 1 CAD 2009-06-04 Bank of Canada closing rate | |
| Show | Edit | Destroy | ||||
| CAD | MXN | 2009-06-05 | CLSE | 0.082910 | CA: 12.0613 MXN = 1 CAD 2009-06-04 Bank of Canada closing rate | |
| Show | Edit | Destroy | ||||
| CAD | NZD | 2009-06-05 | CLSE | 0.695700 | CA: 1.4374 NZD = 1 CAD 2009-06-04 Bank of Canada closing rate | |
| Show | Edit | Destroy | ||||
| CAD | USD | 2009-06-05 | CLSE | 1.096852 | CA: 0.9117 USD = 1 CAD 2009-06-04 Bank of Canada closing rate | |
| Show | Edit | Destroy |
--- !map:HashWithIndifferentAccess action: index controller: currency_exchange_rates=> nil >> -- *** E-Mail is NOT a SECURE channel *** James B. Byrne mailto:ByrneJB at Harte-Lyne.ca Harte & Lyne Limited http://www.harte-lyne.ca 9 Brockley Drive vox: +1 905 561 1241 Hamilton, Ontario fax: +1 905 561 0757 Canada L8E 3C3 From aaron.patterson at gmail.com Mon Jun 15 15:15:38 2009 From: aaron.patterson at gmail.com (Aaron Patterson) Date: Mon, 15 Jun 2009 12:15:38 -0700 Subject: [Nokogiri-talk] Parsing an HTML document In-Reply-To: <53577.216.185.71.24.1245091159.squirrel@webmail.harte-lyne.ca> References: <8be6656c0906141450r6d72660avba65f21ddf0f3a03@mail.gmail.com> <618c07250906141954h19f64434k7d7839751baca94e@mail.gmail.com> <52555.216.185.71.24.1245079825.squirrel@webmail.harte-lyne.ca> <6959e1680906150919h47ee4faer70da0822cb876a4@mail.gmail.com> <34494.216.185.71.24.1245089141.squirrel@webmail.harte-lyne.ca> <6959e1680906151128x1c89695ata2919dd5527eab35@mail.gmail.com> <53577.216.185.71.24.1245091159.squirrel@webmail.harte-lyne.ca> Message-ID: <6959e1680906151215p71f881r993cbac9f2d1323e@mail.gmail.com> On Mon, Jun 15, 2009 at 11:39 AM, James B. Byrne