lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Sat, May 29, 2010 at 16:13, John Edwards <jedwards@numerix-dsp.com> wrote:
> Dear All,
>
> I would like to be able to use Lua to automate the submission of a web form
> E.G. :
>
> <form method="post" action="/cgi-bin/formmail.pl">
> <input name="body" value="" type="hidden">
> <input name="recipient" value="recipient@somedomain.com" type="hidden">
> <strong>Name : </strong><input size="40" name="realname" type="text"><br>
> <strong>Subject : </strong><input size="40" name="subject" type="text"><br>
> <input value="Submit" type="submit"></p>
> </form>
>
> I have seen luasocket but can't find any examples of how to use it to submit
> a form.
> I guess my first question should be is luasocket the correct technique and
> if so, how should I do it ?
>
> Please excuse my lack of knowledge of Lua but I am new to it and hoping to
> find a high level solution such as perl's WWW::Mechanize / LWP.
>
> Thank you very much,
>
> John
>
> PS if this is a FAQ please feel free to point me in the right direction.
>
>

LuaSocket can certainly do it, the same way you'd do it with any other
socket. Craft and send an HTTP POST request. Wikipedia would probably
tell you exactly how. There may be other libraries that make the job
easier, but HTTP is pretty simple.

-- 
Sent from my toaster.