We don't bite newbies here... much | |
PerlMonks |
get with LWP drops HTMLby jialanw (Initiate) |
on Sep 30, 2008 at 04:32 UTC ( [id://714462]=perlquestion: print w/replies, xml ) | Need Help?? |
jialanw has asked for the wisdom of the Perl Monks concerning the following question: Hi all, I'm trying to write a script to download some webpages using LWP. The problem is that the responses I'm getting are incomplete webpages - they only contain some of the content of what I see in my normal browser, omitting seemingly random pieces of code - comments, javascript, forms, etc. Somehow for this given page even a simple 'get' command yields this issue. I've tried using the ->as_string, ->content, and :content_file attributes, but all of them have the missing code problem. Also, the content from 'get' which is saved to the file actually changes on different calls to the program. I've tried it with other websites and it seems to work - is this caused by the website I'm trying to download from? How can I get around it? I do use a cookie to log onto the site, but I don't think that's the problem. Here's the code: -----------------
----------------- As an example of the lost code, here's the code from going to the site and using "Save as" from the browser:
Here's what I get from the saved content file from "get":
Notice that the form has disappeared when using "get". Does "get" reformat the code? Thanks!!
Back to
Seekers of Perl Wisdom
|
|