G'day sbasbasba,

Welcome to the monastery.

"Can't locate object method "new" via package "HTML::TreeBuilder::XPath" at /System/Library/Perl/Extras/5.10.0/Web/Scraper.pm line 115, <F1> line 1."

That pathname (/System/Library/Perl/...) indicates your OS is Mac OS X and you're using the system Perl (i.e. the version of Perl installed by Apple for its own use). You have Web::Scraper installed in /System/Library/Perl/Extras/5.10.0/: this means you've modified your system Perl; I don't know what other modifications you've made. It's generally not a good idea to alter the system Perl. See the responses to "Are there any major Perl issues with Mac OS X Lion?": I posted this question a couple of years ago when I first started using Perl on a Mac; I chose the perlbrew option (and have no problems after 2 years of use and multiple Perl upgrades). I'd recommend you look into perlbrew or an equivalent solution.

Your current problem is probably related to if, and where, you have HTML::TreeBuilder::XPath installed. You may also have other versions of Perl installed. Without more information, I can only provide troubleshooting tips:

[Aside: I noticed you removed part of your original post and replaced it with new content. Please don't do this: it often invalidates comments already made; it can also be useful to subsequent readers to see what was considered and then discarded (i.e. others can learn from your mistakes). The correct way to deal with this is described in "How do I change/delete my post?".]

-- Ken


In reply to Re: Problem in using Web::Scraper, coming from HTML::TreeBuilder::XPath by kcott
in thread Problem in using Web::Scraper, coming from HTML::TreeBuilder::XPath by sbasbasba

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.