Created
September 9, 2021 19:53
-
-
Save jberger/94783fd9458af39f25b6360d62d8c954 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Mojo::Base -strict; | |
use Mojo::DOM; | |
my $html = q!<img src='/__swift/themes/admin_default/images/mimeico_blank.gif' valign='middle' style='position: relative; top: -1px;'> <a href='https://paster.reflected.net/get/665cb7a9-0735-47c9-a33e-3cad17d0b730'><strong>prometheus.20200605.yml</strong></a>!; | |
my $dom = Mojo::DOM->new($html); | |
my $anchor = $dom->at('a'); | |
my $href = $anchor->{href}; | |
my $name = $anchor->all_text; | |
say "$name - $href"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment