how to use perl to connect to the web?

J

jck11

hi all
when I use IE to connect to the www.google.com
I find that my Request Header sends the data 'cookie' ==>
PREF=ID=66f018844077c8d5:TM=1133289512:LM=1133289512:S=EN29yY8uk1D-VVyS

if I want to use perl to connect to the www.google.com
How to fill the cookie field??
Thanks a lot


$req->header(
'Accept' => 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword,
application/x-shockwave-flash, */*',
'Accept-Language' => 'zh-tw',
'Accept-Encoding' => 'gzip, deflate',
'User-Agent' => 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
..NET CLR 1.1.4322; .NET CLR 2.0.50727)',
'Host' => 'www.google.com',
'Connection' => 'Keep-Alive',
'Cookie' => ''); ???? how do I know I must fill the data
'PREF=ID=66f018844077c8d5:TM=1133289512:LM=1133289512:S=EN29yY8uk1D-VVyS' h
 
S

Scott Bryce

jck11 said:
if I want to use perl to connect to the www.google.com
How to fill the cookie field??

You can connect to google.com without filling in the cookie.

If for some reason you feel that you need to, then we need to know
whether you are asking 1) How do I determine what the cookie value
should be, or 2) How do I send that value to google.com, or 3) some
other question.

If you question is 1, then this is not a Perl question, and you will
have to ask elsewhere.

If your question is 2, then you should post a small but complete script
that shows what you have tried, and tell us what it does that is
different than what you expected.

If your question is 3, then you should re-word your question so that it
is clearer.

In any case, please read the posting guidelines for this group. They are
posted here twice a week.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top