can i retrieve the source for a website as a string? for instance could i have $google be the source for www.google.com/search?q=perl
??
Printable View
can i retrieve the source for a website as a string? for instance could i have $google be the source for www.google.com/search?q=perl
??
Yes, it is. How? I don't know. But I have seen scripts that download news from certain webpages to display it on theirs. So yes, it is possible.
You can use the LWP::Simple module to do what you require!
However google have blocked this kind of request on their
'search' script (probbaly to stop people mirroring thier site).
Have a play about with the above script you'll find that if you use this on a server side script you will usually get whatever the script returns, not the actual script itself. But in the case of google thier script checks where the request is coming from and pumps out a forbidden page.Code:#!/usr/bin/perl
use LWP::Simple;
$content = get("http://www.google.com/search?q=perl");
print $content;
You can't download the actual script itself. Otherwise malicious people could find ways to crack your server!
For more info look up LWP::Simple on the search engines!!
:cool:
what do u mean u cant download the script itself? i thought web servers dont let u download actual cgi scripts only the pages that they return right?
Provided they are correctly configured, you are correct.
how correctly configured?
*shrug* The server isn't supposed to give you the source for the CGI script.
Exactly :confused:Quote:
what do u mean u cant download the script itself? i thought web servers dont let u download actual cgi scripts only the pages that they return right?