Results 1 to 10 of 10

Thread: installing from repository: www::mechanize::firefox

  1. #1

    Default installing from repository: www::mechanize::firefox

    hello dear community

    tried on opensuse 12.2 to install WWW::Mechanize::FireFox
    without success
    everytimer i tried it failed.
    the only thing i got success was to do a trial with terminal
    but i failed every time to succeed
    now it did a fresh install on a new machne - with this repo
    now i need WWW::Mechanize::FireFox
    how should i include this -
    how to install !?

    plz advice

    THX DILBERT
    BTW: SEE
    dilbert ;-)
    Wordpress-development - a Toolset: wpgear.org

  2. #2

    Default Re: installing from repository: www::mechanize::firefox

    hello


    the installation instructions notesthe following

    and unfortunatley it dos not tell anything bout repositories for opensuse


    see the documentation


    Source Latest Release: WWW-Mechanize-Firefox-0.68



    MODULE INSTALLATION

    Installing the module is easy:
    1. Download the distribution 2. Unpack it 3. Start a shell in the distribution directory
    4a. With a recent version of the cpan tool, run cpan . there.
    4b. Alternatively run the following commands: perl Makefile.PL make make test make install
    TROUBLESHOOTING

    If you notice that tests get skipped and/or the module installs but "does not seem to work", there are some more steps required to configure Firefox:
    1. Install mozrepl from

    http://wiki.github.com/bard/mozrepl/ A direct link is http://repo.hyperstruct.net/mozrepl/1.0/mozrepl.xpi 2. Launch Firefox
    3. Start mozrepl in Firefox by going to the menu: "Tools" -> "MozRepl" -> "Start" You may want to tick the "Activate on startup" item.
    If tests still fail, especially t/50-click.t and 51-mech-submit.t , this might be because you use the NoScript Mozilla extension and have it blocking Javascript for file:// URLs. While this is good, the tests need Javascript enabled.
    Solution: 1. Open t/50-click.html in Firefox 2. Allow Javascript for all file:// URLs 3. Re-run tests 4. No test should fail
    dilbert ;-)
    Wordpress-development - a Toolset: wpgear.org

  3. #3

    Default Re: installing from repository: www::mechanize::firefox

    hello dear communit- many thanks for all the help.

    well i have bad luck here.


    i tried to install on OpenSuse 12.2 -
    as a superuser SU or
    as Martin - which is a normal ordinary user...

    well all faield untill now.


    see the concrete results that i got back... see the source below....

    and here...

    http://www.schulcenter.org/image_upl...ze_install.pdf





    PHP Code:
    cpan[4]>  install WWW::Mechanize::Firefox


    und in TAP output
    Files
    =83Tests=78,  6 wallclock secs 0.31 usr  0.09 sys +  4.63 cusr  0.59 csys =  5.62 CPU)
    ResultFAIL
    Failed 78
    /83 test programs14/78 subtests failed.
    make: *** [test_dynamicFehler 2
      CORION
    /WWW-Mechanize-Firefox-0.68.tar.gz
    one dependency not OK 
    (MozRepl::RemoteObject); additionally test harness failed
      
    /usr/bin/make test -- NOT OK
    //hint// to see the cpan-testers results for installing this module, try:
      
    reports CORION/WWW-Mechanize-Firefox-0.68.tar.gz
    Running make install
      make test had returned bad status
    won't install without force
    Failed during this command:
     ZIGOROU/MozRepl-0.06.tar.gz                  : make_test NO
     CORION/MozRepl-RemoteObject-0.34.tar.gz      : make_test NO one dependency not OK (MozRepl)
     CORION/WWW-Mechanize-Firefox-0.68.tar.gz     : make_test NO one dependency not OK (MozRepl::RemoteObject); additionally test harness failed

    cpan[4]>  install WWW::Mechanize::Firefox 


    see much much more here -

    http://www.schulcenter.org/image_upl...ze_install.pdf


    love to hear from you

    greetings
    dilbert ;-)
    Wordpress-development - a Toolset: wpgear.org

  4. #4
    Join Date
    Sep 2012
    Posts
    4,976

    Default Re: installing from repository: www::mechanize::firefox

    And what is wrong with
    Code:
    zypper install perl-WWW-Mechanize
    ?

  5. #5

    Default Re: installing from repository: www::mechanize::firefox

    hello dear arvidjaar

    many many thanks for the reply.

    Quote Originally Posted by arvidjaar View Post
    And what is wrong with
    Code:
    zypper install perl-WWW-Mechanize
    ?

    the system replies that this is allreay installed.


    see the full story of a previous trial - that i runned yesterday in order to install www mechanize firefox


    i tried to install on OpenSuse 12.2 -
    as a superuser SU or
    as Martin - which is a normal ordinary user...

    well all faield untill now.

    see the concrete results that i got back... see the source below....
    and here... http://www.schulcenter.org/image_uploads/my_mechanize_install.pdf

    with a full description of the issues . see in very very short


    PHP Code:
    cpan[4]>  install WWW::Mechanize::Firefox


    und in TAP output
    Files
    =83Tests=78,  6 wallclock secs 0.31 usr  0.09 sys +  4.63 cusr  0.59 csys =  5.62 CPU)
    ResultFAIL
    Failed 78
    /83 test programs14/78 subtests failed.
    make: *** [test_dynamicFehler 2
      CORION
    /WWW-Mechanize-Firefox-0.68.tar.gz
    one dependency not OK 
    (MozRepl::RemoteObject); additionally test harness failed
      
    /usr/bin/make test -- NOT OK
    //hint// to see the cpan-testers results for installing this module, try:
      
    reports CORION/WWW-Mechanize-Firefox-0.68.tar.gz
    Running make install
      make test had returned bad status
    won't install without force
    Failed during this command:
     ZIGOROU/MozRepl-0.06.tar.gz                  : make_test NO
     CORION/MozRepl-RemoteObject-0.34.tar.gz      : make_test NO one dependency not OK (MozRepl)
     CORION/WWW-Mechanize-Firefox-0.68.tar.gz     : make_test NO one  dependency not OK (MozRepl::RemoteObject); additionally test harness  failed

    cpan[4]>  install WWW::Mechanize::Firefox 


    see much much more here... http://www.schulcenter.org/image_uploads/my_mechanize_install.pdf

    arvidjaar i love to hear from you


    greetings
    dilbert ;-)
    Wordpress-development - a Toolset: wpgear.org

  6. #6
    Join Date
    Sep 2012
    Posts
    4,976

    Default Re: installing from repository: www::mechanize::firefox

    Quote Originally Posted by dilbertone View Post
    the system replies that this is allreay installed
    So why do you need to install it once more from source?

  7. #7

    Default Re: installing from repository: www::mechanize::firefox

    hello dear arvidjaar many thanks for the reply.

    Quote Originally Posted by arvidjaar View Post
    So why do you need to install it once more from source?







    hello dear friend

    well see the reported issues i got - see the thread here:

    http://forums.opensuse.org/english/o...rt-4242-a.html

    I want to install mozrepl on OpenSUSE version 12.2. It gets pretty tricky - note Mozrepl is a additional part that is needed by the WWW::Mechanize::Firefox::
    I had a bunch of troubles with mozRepl - and I tried to follow the first 3-4 steps from CPAN. I tried to install it with zypper in or with the repo: https://github.com/bard/mozrepl.github

    See many good links and ressources regarding Mechanize - Firefox - Troubleshooting https://duckduckgo.com/html/?q=mozrepl https://github.com/bard/mozrepl.github

    see the issues that were reported:

    https://addons.mozilla.org/en-US/firefox/addon/mozrepl/


    note: does the firefox version 16.01 on opensuse 12.2 cause any issues

    note: mozrepl is listening on port 4242

    note: see the testscript:

    PHP Code:
      use WWW::Mechanize::Firefox;
      
    my $mech WWW::Mechanize::Firefox->new(
          
    tab => 'current',
      );
      
    $mech->get('http://google.com',
          
    ':content_file' => 'google_com.html' ); 
    and the issues

    PHP Code:

    martin
    @linux-wyee:~/perlperl moz_test3.pl
    Can
    't locate WWW/Mechanize/Firefox.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.16.0/i586-linux-thread-multi /usr/lib/perl5/site_perl/5.16.0 /usr/lib/perl5/vendor_perl/5.16.0/i586-linux-thread-multi /usr/lib/perl5/vendor_perl/5.16.0 /usr/lib/perl5/5.16.0/i586-linux-thread-multi /usr/lib/perl5/5.16.0 /usr/lib/perl5/site_perl/5.16.0/i586-linux-thread-multi /usr/lib/perl5/site_perl/5.16.0 /usr/lib/perl5/site_perl .) at moz_test3.pl line 1.
    BEGIN failed--compilation aborted at moz_test3.pl line 1.
    martin@linux-wyee:~/perl> 
    what can i do now!?

    look forward to hear from you

    greetings[/QUOTE]



    see the results

    PHP Code:
    linux-wyee:/home/martin #  perl -v

    This is perl 5version 16subversion 0 (v5.16.0built for i586-linux-thread-multi

    Copyright 1987
    -2012Larry Wall

    Perl may be copied only under the terms of either the Artistic License 
    or the
    GNU General 
    Public Licensewhich may be found in the Perl 5 source kit.

    Complete documentation for Perlincluding FAQ listsshould be found on
    this system using 
    "man perl" or "perldoc perl".  If you have access to the
    Internet
    point your browser at http://www.perl.org/, the Perl Home Page.

    linux-wyee:/home/martin 
    well - i am not sure weather i run one or two perl -versions!? Possible°[/QUOTE]


    well - i am a bit clueless at the moment.

    the scripts that i try to run - from here: WWW::Mechanize::Firefox::Examples - search.cpan.org
    they do not run

    i love to hear from you

    greetings
    dilbert ;-)
    Wordpress-development - a Toolset: wpgear.org

  8. #8
    Join Date
    Sep 2012
    Posts
    4,976

    Default Re: installing from repository: www::mechanize::firefox

    Sorry, I mixed two modules.

    Well, I briefly tried it and in my case test fails due to missing module:
    Code:
    Can't locate HTML/Selector/XPath.pm
    . I am really not interested in installing half of the CPAN So read errors, fix them, test again until no errors is found.
    Code:
    Cant locate WWW/Mechanize/Firefox.pm

    IIRC you had errors building it before so it is probably not installed. You need to fix its installation first.

  9. #9

    Default Re: installing from repository: www::mechanize::firefox

    guess that there were some issues with the make thing

    guess that i have to look for te preliminaries
    dilbert ;-)
    Wordpress-development - a Toolset: wpgear.org

  10. #10

    Default Re: installing from repository: www::mechanize::firefox

    Hello dear All






    i will do all you advice.

    as for now: here some more insights: see the folliwing


    i ve set up another notebook with opensuse - and as i have had various errors with the make - i installed gcc this time. And with this i got more propper results:


    PHP Code:
    cpan[4]>   install WWW::Mechanize::Firefox 
    WWW
    ::Mechanize::Firefox is up to date (0.68). 

    After the installation i used several scripts from the Mechanize-Examples (see here
    WWW::Mechanize::Firefox::Examples - search.cpan.org )

    And i would say that those results were really a bit better than all i got untill now. See the terminal-results - and the corresponding code below...

    example3

    Code:
    martin@linux-ale9:~/perl> perl exa3.pl
    Bareword found where operator expected at exa3.pl line 61, near "--current"
            (Missing operator before current?)
    Bareword found where operator expected at exa3.pl line 63, near "--mozrepl"
            (Missing operator before mozrepl?)
    Bareword found where operator expected at exa3.pl line 65, near "--type"
            (Missing operator before type?)
    Number found where operator expected at exa3.pl line 69, near "over 4"
            (Do you need to predeclare over?)
    Bareword found where operator expected at exa3.pl line 106, near "The"
            (Missing semicolon on previous line?)
    Bareword found where operator expected at exa3.pl line 107, near "at"
            (Missing semicolon on previous line?)
    syntax error at exa3.pl line 51, near "="
    "use" not allowed in expression at exa3.pl line 73, at end of line
    "use" not allowed in expression at exa3.pl line 95, at end of line
    Execution of exa3.pl aborted due to compilation errors.
    martin@linux-ale9:~/perl>



    example5
    Code:
    martin@linux-ale9:~/perl> perl exa5.pl
    Can't find string terminator "JS" anywhere before EOF at exa5.pl line 4.
    martin@linux-ale9:~/perl> perl exa6.pl
    Failed to connect to , Couldn't load "MozRepl::Plugin::Base", "Attempt to reload MozRepl/Plugin/Base.pm aborted.
    Compilation failed in require at /usr/lib/perl5/site_perl/5.16.0/Module/Pluggable/Fast.pm line 82.
    " at /usr/lib/perl5/site_perl/5.16.0/Module/Pluggable/Fast.pm line 84.

    example6

    Code:
    martin@linux-ale9:~/perl> perl exa6.pl
    Failed to connect to , Couldn't load "MozRepl::Plugin::Base", "Attempt to reload MozRepl/Plugin/Base.pm aborted.
    Compilation failed in require at /usr/lib/perl5/site_perl/5.16.0/Module/Pluggable/Fast.pm line 82.
    " at /usr/lib/perl5/site_perl/5.16.0/Module/Pluggable/Fast.pm line 84.

    see the corresponding code - that i have taken from the above mentioned site.

    example-code 3
    Code:
        GetOptions(
            'mozrepl|m:s' => \my $mozrepl,
            'tab:s' => \my $tab,
            'current|c' => \my $use_current_tab,
            'close|q' => \my $close,
            'title|t:s' => \my $title,
            'type:s' => \my $encode_type,
            #'focus|f' => \my $focus,
        ) or pod2usage();
        
        $tab = $use_current_tab ? 'current'
               : $tab ? qr/$tab/
               : undef
               ;
        
        $title ||= getcwd;
        
        my $mech = WWW::Mechanize::Firefox->new(
            tab     => $tab,
            repl    => $mozrepl,
            create  => 1,
            autoclose => $close,
        );
        
        local $/;
        binmode STDIN;
        my $html = <>;
        
        # Find out whether we have HTML:
        if (! $encode_type) {
            if ($html =~ /^\s*</sm) {
                $encode_type = 'html'
            } else {
                $encode_type = 'text',
            };
        };
        
        if ('text' eq $encode_type) {
            my %map = (
            '<' => '&lt;',
            '>' => '&gt;',
            '&' => '&amp;',
            );
            $html =~ s/([<>&])/$map{$1} || $1/ge;
            $html =~ s/\r?\n/<br>/g;
            $html = "<html><head><title>$title</title><body><pre>$html</pre></body></html>";
        };
        
        $mech->update_html($html);
        
        =head1 NAME
        
        bcat.pl - cat HTML to browser
        
        =head1 SYNOPSIS
        
          bcat.pl <index.html
        
        Options:
           --tab            title of tab to reuse (regex)
           --current        reuse current tab
           --title          title of the page
           --mozrepl        connection string to Firefox
           --close          automatically close the tab at the end of input
           --type TYPE      Fix the type to 'html' or 'text'
        
        =head1 OPTIONS
        
        =over 4
        
        =item B<--tab>
        
        Name of the tab to (re)use. A substring is enough.
        
        =item B<--current>
        
        Use the currently focused tab.
        
        =item B<--title>
        
        Give the title of the page that is shown.
        
        =item B<--close>
        
        Automatically close the tab when the input closes. This is good
        for displaying intermediate information.
        
        =item B<--type TYPE>
        
        Force the type to be either C<html> or C<text>. If the type is
        C<text>, line wrapping will be added.
        
        =item B<--mozrepl>
        
        Connection information for the mozrepl instance to use.
        
        =back
        
        =head1 DESCRIPTION
        
        B<This program> will display HTML read from STDIN
        in a browser tab.
        
        =head1 SEE ALSO
        
        The original C<bcat> utility which inspired this program
        at L<http://rtomayko.github.com/bcat/>.
        
        =cut


    example-code 5 perlscript 5


    Code:
            my $ff = Firefox::Application->new();
        
        # Check the network proxy settings
        my $prefs = $ff->repl->expr(<<'JS');
          Components.classes["@mozilla.org/preferences-service;1"]
            .getService(Components.interfaces.nsIPrefBranch);
        JS
        
        print "Your proxy settings are\n";
        print "Proxy type\t",  $prefs->getIntPref('network.proxy.type'),"\n";
        print "HTTP  proxy\t", $prefs->getCharPref('network.proxy.http'),"\n";
        print "HTTP  port\t",  $prefs->getIntPref('network.proxy.http_port'),"\n";
        print "SOCKS proxy\t", $prefs->getCharPref('network.proxy.socks'),"\n";
        print "SOCKS port\t",  $prefs->getIntPref('network.proxy.socks_port'),"\n";
        
        # Switch off the proxy
        if ($prefs->getIntPref('network.proxy.type') != 0) {
            $prefs->setIntPref('network.proxy.type',0);
        };
        
        # Switch on the manual proxy configuration
        $prefs->setIntPref('network.proxy.type',1);
        
        
        =head1 NAME
        
        proxy-settings.pl - display and change the proxy settings of Firefox
        
        =head1 SYNOPSIS
        
        proxy-settings.pl
        
        =head1 DESCRIPTION
        
        This shows how to read and write configuration settings
        from L<about:config> . Particularly, it shows how
        to switch the proxy settings in Firefox on and off.
        
        =cut

    example perlscript 6 - this is a script of my own...
    Code:
        
        #!/usr/bin/perl 
     
    use WWW::Mechanize::Firefox; 
    use strict; 
    use warnings; 
    #use Parallel::ForkManager; 
     
     
     
    #my $fork = Parallel::ForkManager->new(2); 
     
    #sites 
    my @urls = qw(http://www.google.com http://www.yahoo.com http://www.cnn.com http://www.bing.com http://www.nbcnews.com/); 
    #temp base dir 
    my $temp = '/home/aaron/cgi-bin/'; 
     
    for my $each (@urls){ 
        #$fork->start and next; 
        my $mech = WWW::Mechanize::Firefox->new(launch => 'firefox',create => 1,); 
         
        $each =~ /www\.(\w+)\.com/; 
        my $name = $1; 
        print "creating $name.png\n"; 
         
         
        $mech->get($each); 
        my $png = $mech->content_as_png(undef, undef, {width => 240,height => 240}); 
         
        my $dir_name = "$temp/$name".".png"; 
        open my $file, ">", "$dir_name" or die "couldnt create $temp/$1.png"; 
        binmode $file; 
        print {$file} $png; 
         
        close $file; 
        sleep 5; # sleep some to give it a little time to make sure things compleated..... you'll need this more using fork 
         
        #$fork->finish; 
    } 
    print "Well All done!\n"; 
    #$fork->wait_all_children;

    Well - i think that these errors that i have shown above are somewhat different to the others that we discussed in the initlal posting.

    What do you say!? I am interested to hear from you

    greetings.
    dilbert ;-)
    Wordpress-development - a Toolset: wpgear.org

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •