Skip to content

Instantly share code, notes, and snippets.

Last active January 7, 2021 17:01
What would you like to do?
Is there new info on MacRumors yet
#!/usr/bin/env ruby
require 'nokogiri'
require 'open-uri'
model = 'MacBook_Pro_16'
url = "\##{model}"
doc = Nokogiri::HTML(
laptop_section ="//div[contains(@id,'#{model}')]/div[2]/div[2]/div")
puts "#{url}\n\n"
results = do |child|
date ='strong').text
content ='a[1]')[1].text
link ='a[1]')[1].attr('href')
"#{date}: #{content}\n#{link}"
puts results.join("\n\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment