improved WWW::Search?

No, this is not about search engines. A "query" targets a specific web page (usually a HTML or XML page), or a superposition of related pages that share the same structure and whose URLs differ only by some parameter.

Whenever it is executed, the query downloads its target page and extracts information from it, where said information is logically structured as tabular data, and is returned as a sequence of hashes/objects (where each hash/object represents a "row" of the tabular data).

    use Web::Query;
    use Web::Magic;
    use Web::Scraper;
    my $object = ... ; ## xpatish data extraction using magic above

Yes, it's totally possible to do it using those modules, just as it is possible to use LWP::UserAgent and XML::Parser/XML::LibXML/etc. directly as I have been doing.

But then each query definition ends up being a block of imperative source code of some form, which of course provides maximum flexibility, but which I find inconvenient to debug and maintain when dealing with lots of queries. What I'm envisioning, is a declarative approach that is tailored to the use-case of extracting tabular data as described above (and in the future maybe other regularly structured data, such as "scalar" or "flat list"), and allows the user to specify all required information for specifying the query as Perl data (i.e. a hash) rather than as imperative code.

It will have less power and flexibility than the modules you listed, but will hopefully allow query definitions to be neater and more regular, and thus easier to maintain.

PS: Although Web::Magic does look pretty sweet...


In reply to Re^2: RFC: API for declarative parameterized web queries by smls
in thread RFC: API for declarative parameterized web queries by smls

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.