Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

This will crash macruby inconsistently with "incorrect checksum for freed object - object was probably modified after being freed."

View nokogiri_test.rb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
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.