1. If the server says you need either MSIE or Netscape ver x.x you have to fake you use it: $ua->agent('Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)');
  2. You do not have to fiddle with cookies that much. After you give the $ua the cookie jar you do not have to worry.
  3. The parameters should tno be POSTed to the script, they should be passed in the query string:
    use CGI::Enurl; my $request = GET $url_search . '?' . enurl { QRY => 'res', BV_SessionID => $sessID, BV_EngineID => $engID, new_search => 'true', NAM => 'Griffin', GIV => '', LOC => '', STR => '', PCD => 'BT', limit => '50', CallingPage => 'Homepage', };
  4. The site sends a malformated cookie that is not remembered by LWP::UserAgent. Therefore you have to send it with the last request explicitely:
    $request = GET $url_search . '?' . enurl { QRY => 'res', NAM => 'Griffin', lci => '0', PCD => 'BT', start_id => '50', CallingPage => 'Homepage', }, 'Set-Cookie' => "'BV_IDS=$engID:$sessID; path=;";
  5. The URL for the searching is not ".../dq_locationfinder.jsp". It's the ".../dq_home.jsp" itself. ".../dq_locationfinder.jsp" only serves for finding the location on a graphical map.
  6. After all these changes the script worked fine for me. You may find it at http://jenda.krynicky.cz/perl/BT_search.pl.txt.

    HTH, Jenda


    In reply to Re: Re: Re: Re: Requesting webpages which use cookies and session ids. (rev) by Jenda
    in thread Requesting webpages which use cookies and session ids. (rev) by Baz

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



  7. Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  8. Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  9. Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  10. Please read these before you post! —
  11. 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
  12. 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;
  13. Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  14. See Writeup Formatting Tips and other pages linked from there for more info.