CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
Viewing a webpage with a cookie.


New User

Jun 24, 2009, 12:55 PM

Post #1 of 3 (527 views)
Viewing a webpage with a cookie. Can't Post

Hello people! My first post here ^.^"

Okay, let's start the question.

I'm trying now for several weeks to create a little perl script, that can view a page of a forum, and using a cookie when he is viewing the page. Just like you are now doing with this forum. ;)
I want him for example, go to the homepage, click the "New Posts" button, and save that page to a file.
I have the cookie as an .txt, exported from Firefox.

Can anybody please write a little piece of code for me?

Grz tehKitten

p.s. Excuse me for my English if I have made any mistakes, I'm Dutch ;p


Jun 26, 2009, 8:15 AM

Post #2 of 3 (515 views)
Re: [tehKitten] Viewing a webpage with a cookie. [In reply to] Can't Post

You say you have been trying, can we see the code you have been trying?

New User

Jun 27, 2009, 12:39 AM

Post #3 of 3 (502 views)
Re: [KevinR] Viewing a webpage with a cookie. [In reply to] Can't Post

Well.. everytime when a script didn't worked, I deleted it, and created a new one.. But this are my last one's

use LWP::UserAgent; 

# Prepare request.
my $ua = new LWP::UserAgent;
my $req = new HTTP::Request(GET => '');
$req->authorization_basic("Username", "Password");

# Request file.
print "$req\n";


 use LWP::Simple; 
use LWP::Simple::Cookies ( autosave => 1,
file => "E:\cookies.txt" );

# Cookies are now used.


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives