Hi guys,
I’m a newbie to Ruby and having some problems trying to work out how to
tackle a for loop problem.
Basically, I have a website I’m trying to scrape (fantasy football
stats, nothing commerical) in order to enter into a sqlite database.
There is a webpage per player that starts with a 1 and then increments
so basically:
/player/1*
- This number will increment up to approximately 700
What I am trying to do is have a for loop first determine whether the
page exists (i’m guessing is not a 404), then scrape stats from that
page then move onto the next URL (which would be an increment). So:
for (exists)
scrape data
enter into database
url = /player/
I wanted to learn Ruby/Rails in a different way rather than tutorials of
a twitter clone but am having issues with the logic of this problem.
Anyone have any ideas?
Thank you in advance.
Scott.