Skip to content

Instantly share code, notes, and snippets.

@salma71
Last active March 12, 2018 14:23
Show Gist options
  • Save salma71/a155d67d8c543b9795d65495aabaf0b5 to your computer and use it in GitHub Desktop.
Save salma71/a155d67d8c543b9795d65495aabaf0b5 to your computer and use it in GitHub Desktop.
def self.scrape_level_two
name = URI.encode(gets.strip)
agent = Mechanize.new
page = agent.get("http://www.packopumps.com/en/products/different-kind-of-pumps/#{name}")
#get each pump series_list
page.search("div.categoryBlock").collect do |ele|
all_series = self.new
all_series.name = ele.text
all_series
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment