Dearest Monks,

I once again return to the monastery for monk wisdom.

I have been working with WWW::Mechanize. My goal is to browse through my brokerage account and scrape pages and fill our forms to get stock information. I realize I have a lot of challenging work before me in terms of dealing with returned cookies and such in order to finally get in. All I want to get to right now is the point where I can see that I have pulled down the logon page and actually submit my user/pass. Then I can worry (and learn) about the cookies and other verification issues that need to be addressed.

I have read over Mechanize and see its power, but must confess my general lack of fluency with object oriented programming. I have mostly been using perl for link extraction and regex.

So now I am trying to learn some new stuff.

So I know where to start (straight from the docs with simple modifications) ...

use WWW::Mechanize; my $mech = WWW::Mechanize->new(); $url = "http://www.omniomix.com"; $mech->get( $url ); $mech->content( format => "text" ); print $mech;
In the above code I was trying to get a view of the url text that (I had hoped) was extracted.

I got ...

Can't locate HTML/TreeBuilder.pm in @INC [...] at /usr/lib/perl5/site_ +perl/5.8.3/WWW/Mechanize.pm line 496.

And when I do this ...

my $res = $ua->request(HTTP::Request->new(GET => "http://www.yahoo.no" +)); print $res;
I get this ...

LWP::UserAgent=HASH(0x8a415e8)HTTP::Response=HASH(0x8c1df48)

dudes, monks, I am lost.

Any words of wisdom that might help me in my quest would be greatly appreciated.

Thanks Monks,

Chris Herold

In reply to Working with WWW::Mechanize by cdherold

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.