Ubuntu Install Nokogiri

sudo apt update
sudo apt install ruby-dev libmysqlclient-dev build-essential -y
sudo gem install mysql2
sudo gem install nokogiri
Sample html of coingecko
require 'rubygems'
require 'nokogiri'
require 'open-uri'

page = Nokogiri::HTML(URI.open("https://www.coingecko.com/en"))
puts page.css('span[data-coin-symbol="btc"]').text
ruby get_btc_price.rb
Successfully getting Bitcoin price from coingecko

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Kevin FOO

Kevin FOO

15 Followers

A software engineer, a rock climbing, inline skating enthusiast, a husband, a father.