File: entities.pl

package info (click to toggle)
libmojolicious-perl 5.54%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 3,232 kB
  • ctags: 1,223
  • sloc: perl: 9,581; makefile: 10
file content (10 lines) | stat: -rw-r--r-- 349 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
use Mojo::Base -strict;
use Mojo::ByteStream 'b';
use Mojo::UserAgent;

# Extract named character references from HTML spec
my $tx = Mojo::UserAgent->new->get('https://html.spec.whatwg.org');
b($_->at('td > code')->text . ' ' . $_->children('td')->[1]->text)->trim->say
  for $tx->res->dom('#named-character-references-table tbody > tr')->each;

1;