adambot has asked for the wisdom of the Perl Monks concerning the following question:
I have a selector that has a tenancy to change slightly ex: #APP > div > div.hero-PwoFv7gG > table > tbody > tr:nth-child(2) > td > span > span
the div.hero-something is what changes.
The code i have is: my $data = $dom->at('#APP > div > div.hero-PwoFv7gG > table > tbody > tr:nth-child(2) > td > span > span')->text;
however this keeps breaking when the hero-something changes. Would someone be able to point me in the right direction as to how i could make my code more robust? I've tried wildcards in the at but that doesn't work...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: searching with mojo dom
by marto (Cardinal) on Mar 11, 2018 at 08:23 UTC | |
by adambot (Acolyte) on Mar 11, 2018 at 23:56 UTC | |
by marto (Cardinal) on Mar 12, 2018 at 09:49 UTC | |
by adambot (Acolyte) on Mar 11, 2018 at 15:49 UTC | |
by adambot (Acolyte) on Mar 11, 2018 at 20:42 UTC | |
by adambot (Acolyte) on Mar 11, 2018 at 22:28 UTC |