cancel
Showing results for 
Search instead for 
Did you mean: 

lynx help

Shabu Khan-2
Frequent Advisor

lynx help

I haven't used lynx very much and I am hoping someone could assist.

# lynx -auth=user:mypass http://myhost.fqdn:9797/SoapTestTool

This is the URL I am hitting and it is a form. I fill in values for 4 fields and then there is a 'Test' Button, I should hit the test button and that will generate multiple fields where I would need to fill and hit another 'test' button below those fields which would populate another 5 fields which I would again fill and hit the 'test' button (final submit button), this would generate the xml request and I expect a response back.

How can I do this through lynx? Shell script/batch mode would be great.

thoughts?
3 REPLIES
Steven Schweda
Honored Contributor

Re: lynx help

I know nothing, but a Google search for
lynx form submit
led to things like:

http://lynx.isc.org/lynx2.8.5/lynx2-8-5/lynx_help/Lynx_users_guide.html

http://lynx.isc.org/lynx2.8.5/lynx2-8-5/lynx_help/Lynx_users_guide.html#Forms

and a host of others.


> Shell script/batch mode would be great.

For that, I'd look into wget or cURL. Wget,
for example, has command-line options like:

--post-data=STRING use the POST method; send STRING as the data.
--post-file=FILE use the POST method; send contents of FILE.
Shabu Khan-2
Frequent Advisor

Re: lynx help

Thanks Steven.
I did do an online search and came up with the same results and also went through the docs, I was looking for examples and didn't find any, still reading through it to figure it out, while I thought it would be good to post it here and may be someone already had done what I am trying to do ...

I also looked at curl and played with it for a day, the requirement is a bit complex, I've a client that makes a 2-way SSL to a Sentry Appliance (XML Gateway) through which it talks to an outside vendor (1-way ssl from Sentry) and then back. I get a 'bad certificate' error from the client when using curl, I am pretty sure the certificate is fine because the app uses the same certificate to talk via the sentry to the vendor.

Anyways, I did look at wget as well, post-file is probably what I need, but don't know how I would create the file with those variables and values to do the 'POST'. Again, not good documentation/example available ...
Steven Schweda
Honored Contributor

Re: lynx help

> [...] the requirement is a bit complex,
> [...]

Sounds complex to me.

> Again, not good documentation/example
> available ...

I think that I noticed that a while ago.

> This is the URL [...]

Not being able to see the actual HTML makes
it a little tough to make specific
suggestions. The general form resembles the
stuff seen in Web server logs, with (suitably
encoded) "variable1=value1&variable2=value2"
stuff. For example, for a form with specs
like these:









A wget command like the following might be
appropriate:

wget http://www/cgi-bin/form_e-mail.exe \
--post-data=subj=Test+Subject\
&mess=This+is+a+test.\
&subj=A+test&from=sms@some.domain

Alternatively, using --post-file, the file
might contain data like these:

subj=A --post-file test.&from=sms@some.domain&mess= This is a test.
This is only a test.

(With --post-file, the URL encoding is
handled more conveniently by the program.)

When I was fooling around with this stuff
(looks like about six years ago), and I could
find no helpful published examples, I found
it helpful to create a test form on my own
Web server for experimental purposes. That
way it's practical to inspect the Web server
log to see what the program is actually
sending out.