Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
This will crash macruby inconsistently with "incorrect checksum for freed object - object was probably modified after being freed."
require "rubygems"
require "nokogiri"
puts "starting"
html=<<-EOS
<div class="result">
<div>
<h1>
<span class="type">link</span>
<a href="http://yahoo.com">yahoo</a>
</h1>
<h3>title text</h3>
<p>paragraph text</p>
<p class="attribution">
attribution text
</p>
</div>
</div>
EOS
doc = Nokogiri::HTML(html)
puts "Nokogiri parsed the html"
10.times do |t|
print "Run ##{t}: "
results = doc.css("div.result")
results.each do |result|
print"OK"
a=result.at_css("a")
p=result.at_css("p")
div=result.at_css("div")
attribution=result.at_css "p.attribution"
end
puts ""
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.