Created
January 8, 2017 06:59
-
-
Save iurikura/8902f4c585801dd713a754738b0b8920 to your computer and use it in GitHub Desktop.
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 | |
require "open-uri" | |
require "rubygems" | |
require "nokogiri" | |
url = "https://filmarks.com/people/63083" | |
charset = nil | |
html = open(url) do |f| | |
charset = f.charset | |
f.read | |
end | |
doc = Nokogiri::HTML.parse(html, nil, charset) | |
# doc.xpath("<xpathで指定したい場所>" | |
# doc.css("<cssで指定したい場所>") | |
p doc.xpath("//html/body/div[3]/div[2]/div/div[1]/h3").text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment