我正在使用WWW::Mechanize::Firefox
.
当我第二次调用时,它会因错误eval_in_page
而死。dead object
这是我的代码
$mech->get($url);
$mech->eval_in_page('some_fun1(123)');
my @divs = $mech->xpath('//div[@class="sometext"]');
my @data = map { $_->{innerHTML} } @divs;
#...
$mech->eval_in_page('some_fun2(456)'); #dead object error...
my @divs_fun2 = $mech->xpath('//div[@class="sometext"]');
my @data_fun2 = map { $_->{innerHTML} } @divs_fun2;
#...