Answer the question
In order to leave comments, you need to log in
Clicking on blocks ***?
How to click on website buttons using www::mechanize in mozrepl
Firebug shows the button code like this *div*class="uuui-stbutton :float :left*/div*
My attempts to
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[0]);
}
Answer the question
In order to leave comments, you need to log in
Got it :)
#!/usr/bin/perl
use strict;
use warnings;
use WWW::Mechanize::Firefox;
my $mech = WWW::Mechanize::Firefox->new();
#my $id = "google-help";
$mech->get('http://www.youtube.com/');
sleep 10;
$mech->click({ xpath => '//button[@id="google-help"]' });
sleep 10;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question