【发布时间】:2015-10-03 00:02:00
【问题描述】:
我有一个表格要填写,提交后,它会返回结果。 现在,我想计算完成我的请求所花费的时间,即显示结果的时间-我点击提交的时间。
我不知道该怎么做。请随意使用任何模块。我不知道使用哪个参数来检查响应页面是否显示。我使用结果页面的阅读标题只是为了检查响应是否正确显示。
我的代码:
use WWW::Mechanize;
use LWP::UserAgent;
my $m = WWW::Mechanize->new();
$m->get( "http://en.wikipedia.org/wiki/Main_Page" );
$m->submit_form(
form_number => 1,
fields => { search => 'honey', },
button => 'go' #my time1 should start at this moment
);
#my time 2 should be recorded as soon as result page is displayed, i dont know what to use to get this time
$tmp=$m->title;
print "$tmp\n";
【问题讨论】:
标签: perl mechanize www-mechanize