[rspec-users] nokogiri selector help
zach.dennis at gmail.com
Tue Feb 3 22:47:14 EST 2009
On Fri, Jan 30, 2009 at 9:45 PM, Jonathan Linowes
<jonathan at parkerhill.com> wrote:
> On Jan 25, 2009, at 11:58 AM, Zach Dennis wrote:
>> On Sat, Jan 24, 2009 at 12:05 AM, Jonathan Linowes
>> <jonathan at parkerhill.com> wrote:
>>> i want the selector that would return a <tr> of a table if any td
>>> some text, so i can use it in click_link_within
>>> e.g. When I click the "show" link within the row containing
>>> "user at example.com"
>>> When /^I click the "(.+)" link within the row containing "(.+)"$/ do
>>> selector = ??
>>> click_link_within selector, link
>> You can use an XPath selector to find the parent. Try:
>> selector = "//table//tr//td[contains(.,'user at example.com')]//.."
> hi Zach,
> that works as a selector when I do
> doc = Nokogiri::HTML.parse( response.body )
> returns the correct dom elements
> but when used with click_link_within I get the error
> Nokogiri::CSS::SyntaxError Exception: unexpected '//' after ''
Sorry for the late reply, but this is a bug in webrat not a nokogiri
issue. I've created a ticket for it at lighthouse:
More information about the rspec-users