Hello All,

I'm working on some code to automate posting auctions to eBay. I'm using LWP, HTTP::Request, HTTP::Cookies, and the "click" method of HTML::Form to click through the various pages of their new "Sell Your Item 2.0" form. The code works great for most categories, but there are some categories (Men's Clothing, Tickets & Travel, etc...) that have a few extra options like Size, Color, State, # of tickets that are presented in javascript-enabled drop downs. Unfortunately, when my code gets to this stage, it appears to get a blank page in return when I use the click method on the button in the form. I won't post the whole script here because there are different options added depending on where in the process it is, but this should be a reasonable snippet:

use LWP; use HTTP::Request::Common; use HTTP::Cookies; use HTML::Form; my $ua = LWP::UserAgent->new; $ua->cookie_jar(HTTP::Cookies->new(file=>'lwp-cookies',autosave=>1)); # trying to fake a compatible browser, but doesn't work either! $ua->agent("Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)"); my @form = HTML::Form->parse($html, $base_uri); if ($hash{"Category1"}) { $form[0]->value(category1 => $hash{"Category1"} ) ; } my $req = $ua->request($form[0]->click("buttoncontinue")); my $html = $req->content;
Does anyone see anything fishy in this code that would cause it to die when it sees some javascript or anything like that? If anyone would like the complete script to look at, let me know...

Many Thanks in advance!

dirthurts


In reply to using LWP and HTML::Form to submit to eBay by dirthurts

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.