Hello all:
I'm a user of WWW::Mechanize::Firefox 0.33
First I want, is to thank you for this wonderfull an usefull Perl
module, an thank your work about it.
It opens me a new horizon in automation of foreign processes.
Second is I get a into trouble and I don't know if is a feature, or is a
bug.
I read the documentation, search many examples...etc.I get into no way end.
This is the reason that I write. I don'l like to disturb with stupid
questions,
but from my point of view, is something I missunderstand and I'm blocked.
The target web application, is the king of offuscated code html and
javascript, the html tags lack of names and id.
The a elements are made by javascript. The hell. The only reference that
I can obtain is the text of the link.
So I decide use search into innerHTML to locate the clikcable objects
whith this function
sub SearchAndClick($$){
my ($mech,$search)=...@_;
for $object($mech->clickables) {
if($object->{innerHTML}=~/$search/){
print "<OBJ:".$object->__id."
VALUE:".$object->{innerHTML}.">\n";
$m->click($object);
return;
}
}
}
Then match innerHTML to later make a click.
It works pretty for my purposes.
The trouble comes when the clickable object opens a popup in firefox.
The click method keeps in wait state, and the program sequence freeze here.
tcpdump show this continously:
09:37:19.052084 IP localhost.37779 > localhost.4242: P 3312:3404(92) ack
1591 win 3095 <nop,nop,timestamp 956276971 956276971>
e.....@.@................r[E...$...........
8...8...JSON.stringify( function(){ var res = repl.getAttr(664,"busy")
; return { result: res }}())
09:37:19.054648 IP localhost.4242 > localhost.37779: P 1591:1629(38) ack
3404 win 3095 <nop,nop,timestamp 956276972 956276971>
e.....@.@..B...............$.r[......N.....
8...8..."{"result":{"result":0,"type":null}}"
The execution continues when I close the popup manually, when
{"result":{"result":1,"type":null}}
I need to work in the popup window to fill some form and i don't know if
i have to fork to continue or is handle by an event.
Neither know how to reference a mech to the popup open.
¿Some ideas?
Regards.