Created
December 23, 2014 15:39
-
-
Save shirayuca/50498d55c1de45d43728 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
require 'open-uri' | |
require 'nokogiri' | |
url = 'http://www.vorkers.com/company.php?m_id=a0910000000Fr7P' | |
charset = nil | |
html = open(url) do |f| | |
charset = f.charset | |
f.read | |
end | |
doc = Nokogiri::HTML.parse(html, nil, charset) | |
doc.xpath('//ul/li[@class="r1"]').each do |node| | |
p node.text | |
end | |
doc.xpath('//ul/li[@class="r2"]').each do |node| | |
p node.text | |
end | |
doc.xpath('//ul/li[@class="r1_2"]/span[@class="suchiup"]').each do |node| | |
p node.text | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment