Last active
March 12, 2018 14:23
-
-
Save salma71/a155d67d8c543b9795d65495aabaf0b5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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