I am trying to scrape some data. B is the number of pages required for 1000 items to be scraped - there are 22 per page.
usernum = 1000
b = usernum.to_i/22
Array.new(b) {|b| b+1}
I have an array for the number of pages (1000/22 = 45 int.) - [1,2,...44,45] I need to scrape, with each array element pertaining to a page to be downloaded by Nokogiri. I wasn't sure how to proceed.
www.google.com&page=1
www.google.com&page=2
etc. in this case it would need to reach "www.google.com&page=45"
Is it possible to append the prefix to each item of the array? If so, does it make sense to format the array and download each page chronologically, or compile a list of the URLs in an external text file and load them into a method? I'm going to try and add threading.