def find(page_no = 1)
      images = {}
      return images unless @query

      while images.count < @num
        visit search_url(page_no)
        links = Capybara.page.all("a")
        links = links.select{|x| x["href"] =~ /^\/imgres/} if links.any?
        return images unless links.any?
        page_counter = 0
        links.each do |link|
          attribs = CGI.parse(URI.parse(link["href"]).query) rescue nil
          next if attribs.nil?
          hash = Digest::MD5.hexdigest(attribs["imgurl"][0])
          unless images.has_key?(hash)
            images[hash] = {
              width:          attribs["w"][0],
              height:         attribs["h"][0],
              url:            attribs["imgurl"][0],
              reference_url:  attribs["imgrefurl"][0]
            }
            page_counter += 1
          end
        end
        page_no += 1
        break if page_counter == 0
      end
      images.take(@num).map{|x| x[1]}
    end
def find(page_no = 1)
      images = {}
      return images unless @query

      while images.count < @num
        visit search_url(page_no)
        links = Capybara.page.all("a")
        links = links.select{|x| x["href"] =~ /^\/imgres/} if links.any?
        return images unless links.any?
        page_counter = 0
        links.each do |link|
          attribs = CGI.parse(URI.parse(link["href"]).query) rescue nil
          next if attribs.nil?
          hash = Digest::MD5.hexdigest(attribs["imgurl"][0])
          unless images.has_key?(hash)
            images[hash] = {
              width:          attribs["w"][0],
              height:         attribs["h"][0],
              url:            attribs["imgurl"][0],
              reference_url:  attribs["imgrefurl"][0]
            }
            page_counter += 1
          end
        end
        page_no += 1
        break if page_counter == 0
      end
      images.take(@num).map{|x| x[1]}
    end
params: page_no => starting page number for google results