Stupid I know (read on),
Want to propogate through a biomedical website retrieving information. Here is a portion of code:
use LWP::Simple;
use LWP::UserAgent;
use HTTP::Request::Common qw(POST);
use URI::URL;
$url = 'http://<website>/search/gene.asp?';
my $req = POST "$url",
[
ID1 => 48852,
]
$ua = new LWP::UserAgent;
$result = $ua->request($req)->as_string;
print $result;
(Ultimately ID1 will simply be a variable from another part of the program).
Now the problem is, is that it creates a dynamic ASP webpage http://<website>/search/genesrchresults.asp. BUT, you cannot access this directly.
From the script code above $result contains:
HTTP/1.1 302 (Found) Object moved
Cache-Control: private
Connection: Keep-Alive
Date: Mon, 16 Jun 2003 10:40:33 GMT
Location: genesrchresults.asp
Server: Microsoft-IIS/5.0
Content-Length: 140
Content-Type: text/html
Expires: Mon, 16 Jun 2003 09:00:33 GMT
Client-Date: Mon, 16 Jun 2003 10:38:42 GMT
Client-Peer: 63.108.93.17:80
Set-Cookie: ASPSESSIONIDCQTTATSB=JKFMHMDBGODCKACLGPAPBLMB; path=/
Title: Object moved
<head><title>Object moved</title></head>
<body><h1>Object Moved</h1>This object may be found <a HREF="genesrchr
+esults.asp">here</a>.</body>
Well, we get a cookie that changes each time the script is run.
Can (and how can) this cookie be used to extract the required information from genesrchresults.asp?
Regards,
pDuffy
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.