From: Phlip Date: 2008-08-07T11:18:44+09:00 Subject: Re: help with mechanize Jeremy Woertink wrote: > doc.search("/html/body//p") > > why does the "p" need 2 slashes in front? > > It works when I do this, but if I only have 1 slash, then it doesn't > work.. '/html/body/p' will only match immediate children of . Hence a body/div/p, for example, won't match. // searches any descendant. Here are tutorials on XPath for unit tests. Hpricot will also support many of their techniques for functional tests: http://www.oreillynet.com/onlamp/blog/2007/08/xpath_checker_and_assert_xpath.html http://www.oreillynet.com/onlamp/blog/2007/08/assert_hpricot_1.html -- Phlip