А посмотрите что в @buttons попадает.

2015-04-17 15:45 GMT+03:00 Кузьменко Константин <[email protected]>:

> Вот такая дива <div class="uuui-stbutton" style="float: left;"></div>
> Пните для разгона
> use strict;
> use warnings;
> #use WWW::Mechanize::Firefox::Troubleshooting;
> use WWW::Mechanize::Firefox;
> use Crypt::SSLeay;
> use HTML::TagParser;
> use URI::Fetch;
>
> my $url = 'https://site.lobococ/teleport';
> my $mech = WWW::Mechanize::Firefox->new( tab => 'current', );
> &tevtyav;
>
> sub tevtyav {
>     $mech->get($url);
>     sleep 4;
>     my @buttons = grep { $mech->is_visible($_) }
>                        $mech->xpath(q{//div[@class="uuui-stbutton"]//a});
>     $mech->click($buttons[1]);
> }
>
> Вот такое сообщение при выполнении скрипта
> ->click called with undef link at hello.pl line 20.
>         (in cleanup) Can't call method "cmd" on an undefined value at
> C:/Strawbe
> rry/perl/site/lib/MozRepl/Client.pm line 186 during global destruction.
>
> стока 186 Client.pm
> my $message = [map { chomp; $_ } $self->telnet->cmd(String => $command)];
>
> --
>
> С уважением,
> Кузьменко Константин Викторович
>
>
> --
> Moscow.pm mailing list
> [email protected] | http://moscow.pm.org
>
>


-- 
С уважением,
Мышкин Алексей.
-- 
Moscow.pm mailing list
[email protected] | http://moscow.pm.org

Ответить