in reply to Mojo::DOM exception handling help
This is only an educated guess here, as I don't have the facilities currently to test, nor the time to read docs to understand what's happening. Can you extract the object, check for defined, then act appropriately?
Instead of:
my $abstr = $dom1->at('div.abstract-content > p' || 'not provided')->t +ext;
Will something like this example work?:
my $obj = $dom1->at('div.abstract-content > p' || 'not provided'); my $abstr = defined $obj ? $obj->text : 'Object undefined';
If it does work, you could elaborate on it a little, to say log the entries that are broken.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Mojo::DOM exception handling help
by haukex (Archbishop) on Aug 01, 2020 at 19:15 UTC |