Skip to content

Instantly share code, notes, and snippets.

@iurikura iurikura/sample3.rb
Created Jan 8, 2017

What would you like to do?
# -- coding: utf-8
require "open-uri"
require "rubygems"
require "nokogiri"
url = ""
charset = nil
html = open(url) do |f|
  charset = f.charset
doc = Nokogiri::HTML.parse(html, nil, charset)
titles = doc.xpath("//html/body/div[3]/div[2]/div/div/h3")
titles.each do |title|
p title.text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.