I
I
Igor Lobazov2018-05-03 15:33:46
ruby
Igor Lobazov, 2018-05-03 15:33:46

How to iterate through pages in mechanize?

def downloadImages
@images = []

@images = @page.images_with(src: /upload/)

@images.each do |img|
  img.fetch.save
  end

end

def clickOn
  @goods.each do |link|
    link.click 
  end
end

@goods these are product links, you need to go to each one to download all images with the upload address

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question