in reply to Re: I want to be a perl web browser -- what are my best options?
in thread I want to be a perl web browser -- what are my best options?

Crap. It appears that I didn't explain my request well enough.
What I'm looking for is a module, of bundle, that permits me to communicate
with my web server(s), as though I was a web client (browser). Allowing me to
post (speak) HTTP to the web server. Or, speak in the HTTP protocol. Sending
request(s) && replies to the server, and seeing it's (servers) response(s).

I hope this helps clarify my request better, and thank you for taking the time
to respond.

use perl::always;
my $perl_version = "5.12.4";
print $perl_version;
  • Comment on Re^2: I want to be a perl web browser -- what are my best options?

Replies are listed 'Best First'.
Re^3: I want to be a perl web browser -- what are my best options?
by BrowserUk (Patriarch) on Jun 22, 2012 at 05:14 UTC

    LWP::Simple serves most of my (admittedly simple) requirements.

    Even if your requirements are more complicated, it would be a good starting point while you get used to Perlish way.

    Beyond that, there is LWP proper and all it's secure connection extensions. And then WWW::Mechanize and similar beyond that.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    The start of some sanity?

Re^3: I want to be a perl web browser -- what are my best options?
by zentara (Cardinal) on Jun 22, 2012 at 09:13 UTC

      Greetings zentara, and thank you for your reply.
      I see quite a few recomendations for WWW::Mechanize. To tell you the truth
      after posting this question, I went back to work on an old project "docperl",
      that predates that fancy web based version jon allen whipped up. Frankly,
      I like mine better, as it gropes your own server for any/all the modules you already
      have installed, and lists them, as well as producing the pod for viewing. I decided
      it warranted being made public, so I needed to bring it's formatting out of the
      '90's -- can you say Frames/Framesets? :P. Anyway, point being, while using it, I
      discovered I had LWP installed, as a prerequisite for another module I had
      installed. So read up on it, and had figured it to be adequate enough to fulfill my
      needs. But now back here to catch up on "Seekers of Perl Wisdom" posts, you, and
      others in this thread, have really piqued my interest in WWW::Mechanize. After
      glossing over the related link you posted. I'd have to agree, it looks pretty
      nice -- Thanks! :)

      "Perl Web Browser using Gtk2 and WebKit"
      Funny, I just happen to already have both of those installed. I was hoping to get
      some time to explore all that Gtk2 had to offer, so when I noticed it, I
      decided it was a "must have". I'll definitely have a look at that. But alas,
      I'm going to need to get up to speed on WWW::Mechanize. Once I build the
      necessary script(s) || module(s). I'll try and expand on it with the Gtk2
      interface/extension.

      Thanks again, to you, and everyone else, who have taken the time to respond!
      I'll post back to this thread with anything "noteworthy". :)

      use perl::always;
      my $perl_version = "5.12.4";
      print $perl_version;
Re^3: I want to be a perl web browser -- what are my best options?
by Corion (Patriarch) on Jun 22, 2012 at 07:12 UTC

    Mojolicious also has a HTTP client. There also are Web::Magic and the Mechanize (and WWW::Scripter) family of modules which implement HTTP clients that behave like a web browser to various degrees.

    Personally, I like the API that WWW::Mechanize gives, but none of the modules is inherently bad.

Re^3: I want to be a perl web browser -- what are my best options?
by Ea (Chaplain) on Jun 22, 2012 at 15:28 UTC
    There is a nice chapter on just this topic in Perl Testing by Lanworth and chromatic (see http://shop.oreilly.com/product/9780596100926.do ) and gives clear examples using WWW::Mechanize. You'll be up and testing in no time.

    To save you some time, here's a couple of hints from my brief experience:

    # check the html on the page - skip this for brevity $mech->page_links_ok(); html_tidy_ok( $mech->content() );
    This does a lot of work in just two little lines.
    $mech->content_contains( 'Sorry, we couldn’t find anything that +matched your search.' );
    This one took me forever to work out how to match the apostrophe. I went with the html entity in the end.

    perl -e 'print qq(Just another Perl Hacker\n)' # where's the irony switch?
Re^3: I want to be a perl web browser -- what are my best options?
by frozenwithjoy (Priest) on Jun 22, 2012 at 05:11 UTC
    Ah, ok. Well, I'm definitely not an expert on this, so hopefully someone else can help you out. Also, I'm not sure if this is of use, but the things I linked do POST and well as GET, etc.