Last active
February 20, 2025 01:37
-
-
Save suchi/0e334ba97d6a902fcb608492bef62f70 to your computer and use it in GitHub Desktop.
calling URI.open via Kernel#open is deprecated, call URI.open directly
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
# coding: utf-8 | |
# martin bakerから助かった人の数を取得する | |
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
require 'date' | |
html = Nokogiri::HTML(URI.open('https://www.martin-baker.com/')) | |
count_str = html.search('span.w-counter-value-part.type_text'); | |
count = count_str.first['data-final'].to_i | |
date = Date.today.strftime("%Y/%m/%d") | |
puts "#{date}\t#{count}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment