tcordes has asked for the wisdom of the Perl Monks concerning the following question:
I'm having some problems with WWW::Mechanize::Firefox.
The first problem is it fails most tests when installing. I got it to install with force and it seems to work for what I'm doing. I'll give details of the tests at bottom.
The big problem I'm having is that calls seem to take a long time to return. I'm simply doing a get() of a login page (immediately shows in firefox but doesn't return for about 30secs); then a filling in of the login page and a click to submit (fills in and goes to next page in firefox nearly immediately). Then the click() doesn't return for 145secs. Eventually it does return and my script continues. After that I do a get() on a known url on the same site. and it shows up in firefox immediately but takes precisely 30 secs to return. After that, I do a save_url() on an image and another get() on a similar page and the last get hangs forever (I've left it at least 15 mins).
The site I am accessing is extremely js-laden, with all sorts of js happening at all times I'm sure. However, firefox is showing the page immediately and reporting "done" in the status bar (ie: no ongoing loading).
So what's causing the delay? I looked through all docs and googles for details. I tried queue=>0/1 to no avail. I tried timeout=><smaller numbers> to no avail.
I made a small test case using my own web site with tiny static pages with no js in them and the return delay is about 5-10s per page, which is acceptable.
The strangest part is, when it's waiting to return, my cpu load is low. If it's not waiting on I/O or waiting on heavy calculations (tree traversals, etc) then what is it waiting for?
My cpan install errors are like below:
t/01-mech-destroy.t ............... ok t/48-mech-launch.t ................ ok t/49-mech-get-file.t .............. 1/7 # Loading /root/.cpan/build/WW +W-Mechanize-Firefox-0.40-fKA2yZ/t/49-mech-get-file.html MozRepl::RemoteObject: [Exception... "Component returned failure code: + 0x80520015 (NS_ERROR_FILE_ACCESS_DENIED) [nsIWebNavigation.loadURI]" + nsresult: "0x80520015 (NS_ERROR_FILE_ACCESS_DENIED)" location: "JS + frame :: chrome://global/content/bindings/browser.xml :: loadURIWith +Flags :: line 186" data: no] at /root/.cpan/build/WWW-Mechanize-Fire +fox-0.40-fKA2yZ/blib/lib/WWW/Mechanize/Firefox.pm line 623 # Looks like you planned 7 tests but ran 1. # Looks like your test exited with 255 just after 1. t/49-mech-get-file.t .............. Dubious, test returned 255 (wstat +65280, 0xff00)
Yes, my MozRepl was started in the browser beforehand. It works fine without any delays from the mozrepl telnet direct command line. No, I don't have any blockers at all intalled in firefox, except AdblockPlus which is only set to block a few ads on ebay, never anything else. My firefox setup is almost extension/addon free. I can't see anything I would be doing to cause NS_ERROR_FILE_ACCESS_DENIED; I have a pretty stock Firefox setup.
When it's doing the tests, I can see it causing firefox to do things. Some tests take many minutes to run, appearing hung.
My versions are
Thanks graciously!!fedora 12 linux kernel 2.6.32.16-141.fc12.i686.PAE core2quad, 8GB RAM firefox-3.5.15-1.fc12.i686 perl-5.10.0-96.fc12.i686 MozRepl: latest from git as of 2010-12-01 (tried both stable and snaps +hot) WWW::Mechanize::Firefox latest from cpan as of 2010-12-01 WWW::Mechanize latest from cpan as of 2010-12-01 dependencies: # I try to install from Fedora yum rpms when possible js-devel-1.70-8.fc12.i686 perl-parent-0.223-1.fc12.noarch perl-Class-C3-XS-0.13-1.fc12.i686 perl-Algorithm-C3-0.08-2.fc12.noarch perl-Class-C3-0.22-1.fc12.noarch perl-MRO-Compat-0.11-2.fc12.noarch perl-Text-SimpleTable-2.0-2.fc12.noarch perl-Carp-Clan-6.00-5.fc12.noarch perl-IPC-Run-0.84-1.fc12.noarch perl-Data-Dump-1.15-1.fc12.noarch perl-JSON-2.15-5.fc12.noarch perl-Net-Telnet-3.03-9.fc12.noarch perl-YAML-Tiny-1.40-1.fc12.noarch perl-PAR-Dist-0.46-1.fc12.noarch perl-File-Remove-1.42-3.fc12.noarch perl-Module-CoreList-2.17-96.fc12.i686 1:perl-ExtUtils-CBuilder-0.24-96.fc12.i686 1:perl-Module-Build-0.3200-96.fc12.i686 perl-Module-ScanDeps-0.95-1.fc12.noarch perl-Module-Install-0.91-2.fc12.noarch perl-Spiffy-0.30-11.fc12.noarch perl-Algorithm-Diff-1.1902-8.fc12.noarch perl-Text-Diff-1.37-2.fc12.noarch perl-Test-Base-0.58-2.fc12.noarch perl-CPAN-DistnameInfo-0.09-1.fc12.noarch Non-Fedora-rpm cpan dependencies all latest as of 2010-12-01
|
|---|