2
为什么media:group
没有工作,虽然在DOM发生?魔精:: DOM:做一些字符需要特殊的转义?
#!/usr/bin/env perl
use warnings;
use 5.12.0;
use Mojo::UserAgent;
my $ua = Mojo::UserAgent->new();
my $id = 'E7511681ABEA8635';
my $url = 'http://gdata.youtube.com/feeds/api/playlists/' . $id . '?v=2';
my $tx = $ua->get($url);
say $tx->res->dom->at('category')->type;
say $tx->res->dom->at('media:group')->type;
# category
# Can't call method "type" on an undefined value at ./perl.pl line 13
这也适用:如果你在(“集团”),它返回改变的最后一行说$ TX->水库 - > dom->在(“媒体\:组”) - >型; – 2012-04-27 11:44:40