Hi,

This is my first post. I hope it's not TOO awful. :)

I'm currently trying to finish a rather nasty script I've been working on for a while. I'm down to the last section of it, which entails sending search data to a web site and then writing the data retrieved by the web site to a flat file.

I'm pretty familiar with the LWP library at this point. I know how to use UserAgent and Request objects to grab raw HTML using a URL, and I can parse the HTML as well. Thing is, I don't want to have to do that.

The site I'm querying uses forms for input, so I could easily send the data I want to query on (ex. widget 2345A) using a POST method in my Request. However, I've looked at the document source for this site's results page, and it's pretty hideous. I'm assuming that by using a Request object, I'm only going to get the automatically generated result page in HTML in the Response.

Is there any way I can submit the request more directly without having to bother with simulating a form submission via a Request by a UserAgent? Is there any way I can just have the data returned back to me sans HTML document? (ex. $description,$price,$size) If LWP is NOT the correct library, what should I use?

I really have no idea what's running on the site's back end... Sorry! :(

Thanks to anybody who can help.

-------------------------------------------------
Dev Goddess
Developer / Analyst / Criminal Mastermind

"Size doesn't matter. It's all about speed and performance."


In reply to Is there a way to get data from a queried web site without having to parse the resulting HTML? by devgoddess

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.