【发布时间】:2013-09-10 05:08:12
【问题描述】:
Getting the linkedin user profile
my $profile_xml = $li->request(
request_url => 'http://api.linkedin.com/v1/people/~:(id,first-name,last-name,positions,industry,distance)',
access_token => $access_token->{token},
access_token_secret => $access_token->{secret},
);
我得到了结果,但我想分别获取 id、名字、姓氏。如何使用 GetElementByTheTagName 来检索值。
【问题讨论】:
-
你能在这里打印 $profile_xml 的值吗
-
bYdSs9C Jack Rudloph 123456789 2001 2 true vra Systems Information Technology and Services Information Technology and Services 0 像这样在一行中打印它作为 xml 内容接收,我们必须从中提取值。
-
如果结果是数组还是xml格式?如果它在数组 $profile_xml[0]、$profile_xml[1]、$profile_xml[2] 中,将打印 id、first 和 lastnames。如果是 xml 那么你需要解析 xml 文件来获取值。
-
不是数组格式。所以我必须在文件中写入然后必须提取或者是否有任何其他方法可以提取。
-
如果是字符串,则可以拆分字符串:)