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