Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
>> require 'hpricot'
=> true
>> require 'open-uri'
=> true
>> def hopen(url)
>>   @string  = open(url).read
>>   @doc = Hpricot(@string)
>> end
>> hopen 'http://www.boingboing.net/' ; nil
=> nil
>> @string.length
=> 163697
>> @doc.at('#footer-etc')
=> {elem <div id="footer-etc"> "\n    " {elem <div class="block"> "This work is licensed under a " {elem <a href="http://creativecommons.org/licenses/by-nc/2.5/"> "Creative Commons License" </a>} " permitting non-commercial sharing with attribution." </div>} "\n    " {elem <div class="block"> "Boing Boing is a trademark of Happy Mutants LLC in the United States and other countries." </div>} "\n  " </div>}