lib/crypto_price/scraper.rb in crypto_price-0.1.2 vs lib/crypto_price/scraper.rb in crypto_price-0.1.3

- old
+ new

@@ -1,8 +1,11 @@ class CryptoPrice::Scraper def self.scrape_coinmarketcap - doc = Nokogiri::HTML(open("https://coinmarketcap.com")) - doc.css("a.price").text.split("$").select{ |k| k.length > 0 } + #binding.pry + #doc = Nokogiri::HTML(open("https://coinmarketcap.com")) + #doc.css("tbody.span").text.split("$").select{ |k| k.length > 0 } + doc = Nokogiri::HTML(open("https://coinstats.app/?pagesize=50&page=1")) + doc.css("td.data-cell.mobile-last").text.split("$").select{ |k| k.length > 0 } end def self.scrape_coinlib doc = Nokogiri::HTML(open("https://coinlib.io/coins")) prices = self.scrape_coinmarketcap \ No newline at end of file