good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Mojo::DOM exception handling helpby davido (Cardinal) |
on Aug 01, 2020 at 19:35 UTC ( [id://11120210]=note: print w/replies, xml ) | Need Help?? |
This doesn't do anything useful:
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
In Section
Seekers of Perl Wisdom
|
|