I can't test anything here as you haven't actually given us a full URI which you are trying to retrieve. However, here are some things to consider:
- The URI you are trying to call in the first example looks like it might be expecting form data to be POSTed to it. If you try to GET a page that is expecting form data through POST, you are likely to run into problems.
- There is a possibility that content may be generated by scripts. When you save a page from your browser, you may well be saving content that has been rendered by scripts, not just what gets delivered by your HTTP request.
I'm not saying that either of these are the problem, but they should be borne in mind when trying to retrieve pages using simpler user agents such as LWP. Before you start writing your own user agents in Perl or any other language, you really need to know what's going on with the target site. Forms, scripts, cookies and the like that are handled quietly by graphical browsers may need to be addressed in your code.
The best way to get a better picture of what is going on is to use a different browser - something like Lynx. Text-only browsers are far closer to user agents that you might created using LWP than graphical ones like Firefox, Opera, IE, etcetera. At the very least, I would suggest that you test this all out in a browser with JavaScript disabled. Lynx, links, wget and friends are, however, the tools that I'd recommend to get to the bottom of this.
Hope this helps.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.