http://qs321.pair.com?node_id=11120210


in reply to Mojo::DOM exception handling help

This doesn't do anything useful:

'div.abstract-content > p' || 'not provided'

The || operator is a logical short circuit. If the expression on the left is true, that expression's value is returned, and the right-hand side is never evaluated. The string "div.abstract-content > p" is just a plain old string, and evaluates to true. Therefore, the 'not provided' string is never seen. You're not providing an alternate of choice, you're providing only one string as an option.

I'm guessing here but perhaps the path div.abstract-content > p doesn't resolve to anything in the DOM you are parsing. It might be useful for you to provide a sample of the dom, trimmed to show the relevant hierarchy.


Dave