This file contains hidden or 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
| require 'rubygems' | |
| require 'nokogiri' | |
| require 'open-uri' | |
| require 'pry' | |
| url = "http://www.myntra.com/brands?nav_id=2" | |
| doc = Nokogiri::HTML(open(url)) | |
| brand_list = doc.at_css(".brands-list") | |
| brand_name = [] | |
| brand_list.children.css("span").find_all{|y|brand_name<< y.text} |
This file contains hidden or 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
| Stock Options | |
| 79 14 3 21 104 54 12 9 94 1 96 103 | |
| require 'rubygems' | |
| require 'pry' | |
| a =[79, 14, 3, 21, 104, 54, 12, 9, 94 , 1 , 96, 103] | |
| max_profit =0 | |
| max_value = a[a.size-1] |
This file contains hidden or 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
| require 'rubygems' | |
| require 'net/http' | |
| require 'nokogiri' | |
| require 'pry' | |
| require 'open-uri' | |
| module CnnScrapper | |
| class CnnParser | |
| URL = "http://edition.cnn.com" |
OlderNewer