[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
lynx-dev Re: -post_data sample please
From: |
Yury Burkatovsky |
Subject: |
lynx-dev Re: -post_data sample please |
Date: |
Thu, 19 Aug 1999 13:14:37 +0300 (IDT) |
Try the instructions from the attached piece of mail. Actually, to got the
neccessary data I replaced the "ACTION" attibute value with
"mailto:address@hidden" instead of performing steps 4-8. See below how
your form worked out.
BTW, I think it is worthwhile adding to the FAQ, isn't it?
--
Regards, | /^^^\
Yury | (| , , |)
| | * |
E-mail: yury.burkatovsky at telrad dot co dot il | \_-_/
On Tue, 17 Aug 1999, Reza wrote:
> I have tried numerous variations of the command "lynx -post_data". Non
> give correct results, even though some output totally irrevant stuff. I
> am using RedHat Linux. Please give a WORKING sample if you can. Thank
> you.
>
On Mon, 24 Mar 1997, A. R. Vener wrote:
>
> Date: Mon, 24 Mar 1997 20:41:51 -0500 (EST)
> From: "A. R. Vener" <address@hidden>
> To: address@hidden
> Subject: Re: using Lynx as an automatic agent step by step
>
> As Henry requested here it is:
>
> Step 1: Follow the links to the link where the form is located. Don't actually
> enter that page. Stop just before you enter.
> Step 2: Hit your Download key. For me that's D on Lynx 2.7
> Step 3: specify a file name for the downloaded html such as tmp.html
> Step 4: First make note of the cgi script path in the action= firld.
> Then edit the form to replace the action=<their cgi script> with
> an action=<your cgi script>
> Your cgi script should simply email the resulting cgi data
> string to you or save it to a file. I just wrote a C program
> to dump the string into a file.
> Step 5: place the downloed and edited html form under your web page
> step 6: place your cgi script into your cgi bin
> step 7: run lynx and enter the data you want to use in the form
> in the tmp.html form.
> Step 8: submit the form. This should either save the cgi string or email it
> to you depending on what action your script takes.
> Step 9: save the cgi string in a fila, call it cgidata for now.
> step 10: create a script file which contains the command:
> lynx -get_data http://www.whatever.com/their/cgi/path < cgidata > output
> OR
> lynx -post_data http://www.whatever.com/their/cgi/path < cgidata > output
> The correct method (Get or Post) should be specified in the tmp.html
> file you downloaded. Note that I had to change their GET to a POST since
> my
> server objects violently to using GET...
>
> Hope this helps.
>
> Rudy Vener
Your example follows:
<html>
<form method=POST
action="mailto:address@hidden">
^^^^^^^^^^^^^^
my replacement
<input type="hidden" name="subsequent-query"
value="%28browse%5Fcategory%20%3D%20%2268682%22%29and%28enddate%20%3D%20%22934502155-%22%29">
<input type="hidden" name="start" value="50">
<input type="hidden" name="hint2" value="5">
<input type="hidden" name="hint3" value="67">
<input type="hidden" name="hint4" value="6">
<input type="hidden" name="hint5" value="">
<input type="hidden" name="hint6" value="0">
<input type="hidden" name="domain" value="56">
<a name=moremore><input type="submit" value="More"></a>
</form>
</html>
When I submitted your modified form, I had a mail with attachment of type
Application/X-WWW-FORM-URLENCODED at my mailbox:
subsequent-query=%2528browse%255Fcategory%2520%253D%2520%252268682%2522%2529an
d%2528enddate%2520%253D%2520%2522934502155-%2522%2529&start=50&hint2=5&hint3=6
7&hint4=6&hint5=&hint6=0&domain=56
I saved the attachment in file sample.data and ran command
lynx -accept_all_cookies -post_data
http://auctions.amazon.com/exec/varzea/subsequent-query/qid=934502155/002-2579128-3212046
< /tmp/sample.data
The option -accept_all_cookies is needed so as lynx could process offline
all the cookies that the site suggests, otherwise the command hangs.
The output was:
[1][LINK]-[2][USEMAP:topnav_new.gif]
[3][LINK]-[4][USEMAP:subnav-browse.gif]
Auction Search: _______________ Go
Browse: [All Categories.................] Go
02:59:00 PDT
[5]Auctions / [6]Collectibles / [7]Paper / Sheet Music [8]Sell an item
now in Sheet Music
Full Results:
.......................
- lynx-dev Re: -post_data sample please,
Yury Burkatovsky <=