J
Joel Dezenzio
Hi everyone:
I'm a newcomer to Ruby and started learning it approximately one-week
ago. I learn very fast (I have a photographic and logical memory) and
own a large section of books...
I wanted my first program to be a scraper as I do a lot of DB
administrative work on several websites and keep a listing of statistics
- namely college football statistics.
I found a very good parsing idea posted on one site but it didn't
utilize classes so I redesigned and developed it to be more modular with
what I was after...
For what I have so far - it works 99% with only one problem.
In the method for clean_celldata I'm trying to search through an array
of arrays and find one cell that contains either an empty space or the
symbol ( Â ). I want to replace that cell data with the number 120.
My problem is that I haven't become as familiar as I need to be with
map/collect and other array functionality.
I've enclosed an attachment that contains the working program, class and
methods for Scraper.rb. When you test it out, you'll see the puts data
and if you go to the bottom row (western kentucky) you'll see there's no
ranking number assigned. On the original website the cell is empty but
ruby processes it as the symbol ( Â ). I want to remove that and
replace it with the number 120 within the method called clean_celldata.
Many thanks in advance and I really am enjoying my first attempt at a
real object-oriented language. I've worked in the past with PHP,
Autoit, C++, and VB..
Attachments:
http://www.ruby-forum.com/attachment/3735/scraper.rb
I'm a newcomer to Ruby and started learning it approximately one-week
ago. I learn very fast (I have a photographic and logical memory) and
own a large section of books...
I wanted my first program to be a scraper as I do a lot of DB
administrative work on several websites and keep a listing of statistics
- namely college football statistics.
I found a very good parsing idea posted on one site but it didn't
utilize classes so I redesigned and developed it to be more modular with
what I was after...
For what I have so far - it works 99% with only one problem.
In the method for clean_celldata I'm trying to search through an array
of arrays and find one cell that contains either an empty space or the
symbol ( Â ). I want to replace that cell data with the number 120.
My problem is that I haven't become as familiar as I need to be with
map/collect and other array functionality.
I've enclosed an attachment that contains the working program, class and
methods for Scraper.rb. When you test it out, you'll see the puts data
and if you go to the bottom row (western kentucky) you'll see there's no
ranking number assigned. On the original website the cell is empty but
ruby processes it as the symbol ( Â ). I want to remove that and
replace it with the number 120 within the method called clean_celldata.
Many thanks in advance and I really am enjoying my first attempt at a
real object-oriented language. I've worked in the past with PHP,
Autoit, C++, and VB..
Attachments:
http://www.ruby-forum.com/attachment/3735/scraper.rb