From: Phlip Date: 2008-08-13T09:47:29+09:00 Subject: Re: Hpricot and xpath > tag1.rb:6: undefined method `xpath' for nil:NilClass (NoMethodError) Do you see the nil in that line? Where is the nil coming from? Is the method before the .xpath, on line 6, possibly returning a nil and not an Elem? After pondering that, switch '#header' to '.header'!