Controlling elinks from Pipe, CLI or Script

Hi guys,

I�m looking for an automatic way to save the source code of an website to a file. My questions is, it is possible to control elinks from a script, pipe or cli? I need to open a website, login on this site by a webform, submit the form, open an new url and save the source code of a data-sheet on this site. Can anybody help me?

Thanks for your answer.

Can you share what you've already done? And have you looked at man curl (linux) or man wget (linux)?
-DL

Yes, i have tested curl and wget, but i don't get the source-code of the page because there are some problems with javascript. I've got the following source code:

 <html>
 <head>
 <script language='javascript'>function autoNavigate() {window.location="data.html";}</script>
 </head>
 <body onload='autoNavigate()'></body>
 </html>
 

This is the same url as i loaded before. The javascript code reload the same page. But if i load the url with curl or wget a second time, i get a 302 Error.

The same problems by using "lynx" and "w3m". Only "links" and "elinks" shows the content of the page correctly. Thats why i'm looking for a possibility to control the text-browser from a script.

Thanks

---------- Post updated 12-02-14 at 02:37 PM ---------- Previous update was 12-01-14 at 04:59 PM ----------

Here the solutions:

controlling browser from pipe:
https:// vimeo.com/19616296

Controlling browser from script with expect:
http:// expect.sourceforge.net/
you can use autoexpect to record all inputs.