Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > LWP::Simple and Cookies not working

Reply
Thread Tools

LWP::Simple and Cookies not working

 
 
Dan
Guest
Posts: n/a
 
      12-23-2003
I have a script that does a search of completed Ebay auctions for
certain items. All was fine until a few weeks ago, when Ebay changed it
so that one must login in order to search completed items. I've modified
the script to support cookies for the login information after searching
on deja. The script seems fairly simple, but the get() statement returns
a page that claims that the browser does not support cookies. I can't
see what I'm missing here

Code follows. You'll need a valid Ebay USerID and password to test it.
Thanks in advance.

-Dan

# !/user/bin/perl

use LWP::Simple qw ($ua get);
use HTTP::Cookies;

$ua->cookie_jar(HTTP::Cookies->new);

# Modify the following as needed.

$Login = "login";
$Password = "password";

$URL="http://signin.ebay.com/aw-cgi/eBayISAPI.dll?MfcISAPICommand=SignInWelcome&siteid =0&co_partnerId=2&UsingSSL=0&pp=&pa1=&pa2=&pa3=&il =-1&pageType=1637&userid="
.. $Login . "&pass=" . $Password .
"&keepMeSignInOption=1&ru=http://search-completed.ebay.com:80/search/search.dll?GetResult&catref=C3&category1=1 049&sr=0&query=craaft&lotr=1&compl etedonly=1&from=R2";

$content = get $URL;

open (TMPOUT, ">ebaytest.out");

print TMPOUT $content;

close TMPOUT;

 
Reply With Quote
 
 
 
 
Matt Garrish
Guest
Posts: n/a
 
      12-23-2003

"Dan" <(E-Mail Removed)> wrote in message
newsv3Gb.120414$8y1.373415@attbi_s52...
> I have a script that does a search of completed Ebay auctions for
> certain items. All was fine until a few weeks ago, when Ebay changed it
> so that one must login in order to search completed items. I've modified
> the script to support cookies for the login information after searching
> on deja. The script seems fairly simple, but the get() statement returns
> a page that claims that the browser does not support cookies. I can't
> see what I'm missing here
>


By default $ua will identify itself as the libwww version you are using.
There's nothing stopping you from telling the server you're something else:

$ua->agent('Mozilla/5.0');

(untested, however, as I have no interest in ebay... : )

Matt


 
Reply With Quote
 
 
 
 
Charles DeRykus
Guest
Posts: n/a
 
      12-30-2003
In article <Pv3Gb.120414$8y1.373415@attbi_s52>,
Dan <(E-Mail Removed)> wrote:
>...
>
>use LWP::Simple qw ($ua get);
>use HTTP::Cookies;
>
>$ua->cookie_jar(HTTP::Cookies->new);
>
># Modify the following as needed.
>
>$Login = "login";
>$Password = "password";
>
>$URL="http://signin.ebay.com/aw-cgi/eBayISAPI.dll?MfcISAPICommand=SignInWelcome&siteid =0&co_partnerId=2&UsingSSL=0&pp=&pa1=&pa2=&pa3=&il =-1&pageType=1637&userid="
>. $Login . "&pass=" . $Password .
>"&keepMeSignInOption=1&ru=http://search-completed.ebay.com:80/search/search.dll?GetResult&amp;catref=C3&amp;category1=1 049&amp;sr=0&amp;query=craaft&amp;lotr=1&amp;compl etedonly=1&amp;from=R2";
>
>$content = get $URL;
>
>open (TMPOUT, ">ebaytest.out");
>
>print TMPOUT $content;
>
>close TMPOUT;
>


Sorry, I've never gone near Ebay..

May not help but have you done any sleuthing with debug settings:

use LWP:ebug qw(+);

Another longshot but you can peek into the cookie jar too:

my $jar = HTTP::Cookies->new(...);
...
print $jar->as_string if $DEBUG;

--
Charles DeRykus
 
Reply With Quote
 
Brian Wakem
Guest
Posts: n/a
 
      08-19-2005
EvilOverlord wrote:

> Hi,
>
> Did you ever find a solution to this problem?
>
> I ran into exactly the same problem today trying to write very much the
> same perl script as yours.
>
> Enabling debug and examining the cookie shows that it seems to have been
> accepted OK. Ebay simply thinks otherwise. I have also changed the user
> agent with no luck either.
>
> I really don't know why eBay are so determined to stop me doing a simple
> completed items search.



Who are you talking to?

Don't re-invent the wheel -
http://search.cpan.org/search?query=ebay&mode=module


--
Brian Wakem
Email: http://homepage.ntlworld.com/b.wakem/myemail.png
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Give Request.Cookies and Response.Cookies is there any reason to use another method to use cookies? _Who ASP .Net 7 09-18-2008 07:49 PM
Persistant cookies and non-persistant cookies. archana ASP .Net 1 05-25-2007 08:43 AM
Cookies working on intranet but NOT working on Internet Martin Heuckeroth ASP .Net 5 04-01-2005 01:37 AM
Response.Cookies vs Request.Cookies Alex Nitulescu ASP .Net 1 02-03-2005 09:43 AM
Persistent Cookies vs. session cookies Andy Fish Java 3 11-06-2003 10:44 AM



Advertisments